You are here:
es.ActiveXperts.com > Twitter Toolkit
quicklinks
The ActiveXperts Twitter Toolkit enables any Windows or web application to integrate Twitter functionality. Your application will be able to send Tweets as well as view different time lines, find and follow users etc.
![]() |
![]() |
![]() |
![]() |
![]() |
| Startup screen | MS Visual Studio | .NET web application | .NET GUI application | Console application |
The ActiveXperts Twitter Toolkit supports the following:
ActiveXperts Twitter Toolkit is available as a 32-bit component and as a 64-bit component (both part of the product):
ActiveXperts Twitter Toolkit runs on the following Operating Systems:
For most of these samples you will need to have a consumer key and an access key. Use this wizard to get both a consumer key and an access key.
The following code sample illustrate OAuth authorization for a client application using the Twitter Toolkit.
Option Explicit Dim objTwitter, objIE Dim strUrl, strVerify ' Create the twitter object Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) ' Set the consumer key objTwitter.ConsumerKey = "..................." objTwitter.ConsumerSecret = ".........................................." ' Request an authorization URL strUrl = objTwitter.RequestAuthorization TestSuccess ' Navigate to the Authorization URL Navigate strUrl ' While on the Authorization URL, ask the user to input the verification code strVerify = inputbox( "Enter verification code", "Enter value", "" ) ' Trade the verify token with an access token objTwitter.RequestAccessToken strVerify TestSuccess ' Tweet about our success ! objTwitter.Tweet "I'm Tweeting with ActiveXperts Twitter Toolkit !" TestSuccess ' Print the access token so it can be used again. WScript.Echo "Access token: " & objTwitter.AccessToken WScript.Echo "Access token secret: " & objTwitter.AccessTokenSecret ' ************************************************************************************* ' Navigate to a specific URL Function Navigate( strUrl ) Set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate strUrl objIE.Visible = 1 Do While objIE.Busy Loop End Function ' Test if a function call on the Twitter Toolkit object succeeded Function TestSuccess() Dim strDescription If objTwitter.LastError <> 0 Then strDescription = objTwitter.GetErrorDescription(objTwitter.LastError) WScript.Echo "Failed, error: " & objTwitter.LastError & "; " & strDescription WScript.Quit 1 End If End Function
Option Explicit
Dim objTwitter, objTweet, objUser
' Create the twitter object
Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
' Set the consumer key
objTwitter.ConsumerKey = "..................."
objTwitter.ConsumerSecret = ".........................................."
' Set the user key
objTwitter.AccessToken = ".................................................."
objTwitter.AccessTokenSecret = ".........................................."
' List tweets and the users who posted them
' The tweets are from a specific time-line. The following time-lines are possible:
' "public", "home", "friends", "mentions", "retweeted_by_me", "retweeted_to_me",
' "retweeted_of_me" or either a user id or screen name
Set objTweet = objTwitter.FindFirstTweet("home")
While objTwitter.LastError = 0
WScript.Echo "Id: " & objTweet.Id
WScript.Echo "Created at: " & objTweet.CreatedAt
WScript.Echo "Text: " & objTweet.Text
WScript.Echo "Source: " & objTweet.Source
Set objUser = objTweet.User
WScript.Echo "By:"
WScript.Echo vbTab & "Id: " & objUser.Id
WScript.Echo vbTab & "Created at: " & objUser.CreatedAt
WScript.Echo vbTab & "Name: " & objUser.Name
WScript.Echo vbTab & "Screen name: " & objUser.ScreenName
WScript.Echo vbTab & "Location: " & objUser.Location
WScript.Echo vbTab & "Description: " & objUser.Description
WScript.Echo vbTab & "Profile image: " & objUser.ProfileImage
WScript.Echo vbTab & "URL: " & objUser.URL
WScript.Echo vbTab & "Protected: " & objUser.Protected
WScript.Echo vbTab & "Followers: " & objUser.NumFollowers
WScript.Echo vbTab & "Friends: " & objUser.NumFriends
WScript.Echo vbTab & "Tweets: " & objUser.NumTweets
Set objTweet = objTwitter.FindNextTweet
WEnd
Option Explicit Dim objTwitter, objStatus, objUser ' Create the twitter object Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) ' Set the consumer key objTwitter.ConsumerKey = "..................." objTwitter.ConsumerSecret = ".........................................." ' Set the user key objTwitter.AccessToken = ".................................................." objTwitter.AccessTokenSecret = ".........................................." ' Get all of your followers Set objUser = objTwitter.FindFirstFollower While objTwitter.LastError = 0 WScript.Echo "--" WScript.Echo "Id: " & objUser.Id WScript.Echo "Created at: " & objUser.CreatedAt WScript.Echo "Name: " & objUser.Name WScript.Echo "Screen name: " & objUser.ScreenName WScript.Echo "Location: " & objUser.Location WScript.Echo "Description: " & objUser.Description WScript.Echo "Profile image: " & objUser.ProfileImage WScript.Echo "URL: " & objUser.URL WScript.Echo "Protected: " & objUser.Protected WScript.Echo "Followers: " & objUser.NumFollowers WScript.Echo "Friends: " & objUser.NumFriends WScript.Echo "Tweets: " & objUser.NumTweets Set objUser = objTwitter.FindNextUser Wend
Option Explicit Dim objTwitter, objXML, objNodeList, strResult, i ' Create the twitter object and an XMLDOM object Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) Set objXML = CreateObject( "Microsoft.XMLDOM" ) ' Set the consumer key objTwitter.ConsumerKey = "..................." objTwitter.ConsumerSecret = ".........................................." ' Set the user key objTwitter.AccessToken = ".................................................." objTwitter.AccessTokenSecret = ".........................................." ' Make a custom API call strResult = objTwitter.APICall("statuses/home_timeline", "xml") ' Display the results objXML.LoadXML(strResult) Set objNodeList = objXML.selectNodes("//statuses/status/text") For i = 0 To objNodeList.length WScript.Echo objNodeList(i).text Next
To read more about ActiveXperts Twitter Toolkit, use one of the following links: