Language: PowerShell
secure tweet from powershell
function Send-Tweet { param ([string]$tweet) $twitUrl = "https://twitter.com/statuses/update.xml" $str = "status=" + $Tweet Post-Twitter $twitUrl $str } function Send-DirectTweet { param ([string]$tweet,[string]$recipient) $twitUrl = "https://twitter.com/direct_messages/new.xml" $str = "text=" + $tweet + "&user=" + $recipient Post-Twitter $twitUrl $str } function Post-Twitter { param ([string]$twitUrl,[string]$str) $WebClient = New-Object System.Net.WebClient try{ $WebClient.Credentials = Get-Credential -Credential "kentelmer" [System.Net.ServicePointManager]::Expect100Continue = $false $response = $WebClient.UploadString($twitUrl,$str) #$response } catch { write-host "Error text: " $_ write-host "Exception: " $_.Exception.GetType() } finally { $WebClient.Dispose } }
by
January 18, 2010 @ 5:49pm
January 18, 2010 @ 5:49pm
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

