How to post a tweet to twitter using Powershell?

Question:

Has anyone used the following code? How do I make it post a tweet? I know I have to use the “$req.Context.RawUri = [Uri]'http://api.twitter.com/version/statuses/update.xml” but I can’t get the “$res = [xml][DevDefined.OAuth.Consumer.ConsumerRequestExtensions]::ReadBody($req)” right.

Answer:

I use OAuth by DevDefined as well. My function looks like this:

Then for simplicity I pass status in query string:

It seems that you know about the consumer key/secret and the token thing, so I’ll leave it without further explanation.

Source:

How to post a tweet to twitter using Powershell? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply