Search code examples
vb.nettwitter

Posting tweets from vb.net


How could I post custom tweets on my twitter account using vb.net?

If is not possible, which I doubt, is there any way to achive this with c# or javascript?


Solution

  • You can use the twitterizer library.


    Here's an example how to use it:

    Dim tokens As New OAuthTokens()
    tokens.AccessToken = "XXX"
    tokens.AccessTokenSecret = "XXX"
    tokens.ConsumerKey = "XXX"
    tokens.ConsumerSecret = "XXX"
    
    Dim tweetResponse As TwitterResponse(Of TwitterStatus) = TwitterStatus.Update(tokens, "Hello, #Twitterizer")
    
    If tweetResponse.Result = RequestResult.Success Then
            ' Tweet posted successfully!
    Else
            ' Something bad happened
    End If
    

    BTW, here's a list of avaiable twitter libraries (but it's not 100% up-to-date).