ActiveXperts Twitter Toolkit Manual

© 1999-2010 ActiveXperts Software B.V.  contact@activexperts.com

 

1. Introduction

1.1. Introduction

Twitter is a popular social networking service that enables its users to send and read messages called Tweets. Tweets are text-based posts of up to 140 characters. They are displayed on the author's profile page.

Twitter users can send and receive tweets through the Twitter website or through compatible applications. Applications that want to send or receive tweets can use the ActiveXperts Twitter toolkit.

The ActiveXperts Twitter Toolkit supports the following:

  • Post your Tweets on Twitter using your own software
  • Easy browsing through your own Tweets or the Tweets on any other time-line
  • Easy browsing through friends and followers
  • Integrated OAuth (Open Authorization) supports both client and browser applications
  • Authenticate users in only two API calls
  • Access all of the functions that are publicly available on the Twitter RESTfull interface
  • Proved an interface to send custom, OAuth signed, requests to the Twitter RESTfull interface

1.2. Architecture

The ActiveXperts Twitter Toolkit provides it's users with an easy to use front end on the Twitter REST API. By installing the Twitter Toolkit ActiveX component you will be able to access its interface from most programming languages and environments such as: C#, C++, VB.NET, Delphi, PHP, ASP, ASP.NET, Javascript, etc.. The Twitter Toolkit provides its own API as well as a way to automatically sign direct calls to the Twitter REST API. This ensures that the Twitter Toolkit will always support everything that is supported by Twitters own REST API as well as a straightforward way to access Twitters basic functions.

The core of ActiveXperts Twitter Toolkit is an ActiveX/COM component that comes in a 32-bit and a 64-bit version:

  • TwitterTk.dll, 'Twitter COM Component' for 32-bit platforms
  • TwitterTkx64.dll, 'Twitter COM Component' for 64-bit platforms

The ActiveXperts Twitter Toolkit can be distributed easily to any server and workstation in your network since only the file related to the target platform (32 or 64 bit) is required.

1.3. OAuth Authorization

Twitter relies on the OAuth (Open Authorization) standard for authorizing its users when trying to access information about protected users or API functions. OAuth is different from many authorization methods in that it allows users to authorize applications to use a resource on their behalf without handing out their credentials. Find more information on the OAuth getting started page.

To be able to post tweets or to look at a protected users time-line using the Twitter toolkit you will need the following:

  • Consumer token and secret. This identifies your application to Twitter.
  • Access token and secret. This identifies the user as well as the fact it granted access to your application.

Before your application can ask a user to grant access to their Twitter account it needs to have its own consumer token and consumer secret. You can get these by registering your application with twitter here.

With a consumer token and secret you can ask a user to grant access to your application. If the user grants access you will receive an access token as well as an access secret. With these you can act an behalf of the user as long as the user does not revoke your access through the Twitter web interface.

In addition the OAuth standard offers two use cases. A client use case for stand alone applications and a web use case for better integration into a web application. The Twitter toolkit provides support for both use cases.

With the Twitter Toolkit we aimed at greatly simplifying the OAuth process by only requiring two function calls which integrate both the web and client use cases. First call the RequestAuthorization method to request the authorization URL. Next call RequestAccessToken to request the actual access token and secret. Find examples in the Introduction of the How to Use section. Or look at our consumer and access key wizard

2. System Requirements

2.1. System Requirements

The Twitter Toolkit can be used by any of the following operating systems:

  • Windows XP, x86 (32-bit) and x64 (64-bit)
  • Windows 2003, x86 (32-bit) and x64 (64-bit)
  • Windows 2008, x86 (32-bit) and x64 (64-bit)
  • Windows Vista, x86 (32-bit) and x64 (64-bit)
  • Windows 7, x86 (32-bit) and x64 (64-bit)

NOTE: On 64 bits systems, you can run 32- and 64 bit programs. To integrate The Twitter Toolkit in a 64-bit (web) application of service, use the 64-bit TwitterTkX64.dll. To integrate The Twitter Toolkit in a 32-bit (web) application of service, use the 32-bit TwitterTk.dll.

2.2. Support Development Platforms

The Twitter Toolkit can be used by any of the following programming languages:

  • Visual Basic .NET
  • Visual C# .NET
  • Visual Basic 5.x or higher
  • Visual C++ 5.x or higher
  • Delphi 6.x or higher
  • ASP .NET
  • ASP classic
  • PHP
  • ColdFusion
  • VBScript
  • Javascript
  • HTML
  • Any other development platform that supports ActiveX/COM components

3. Installation

3.1. Installation

To install the components simply run the TwitterTK.EXE Setup program. The InstallShield wizard will guide you through the rest of the setup. The Setup program can perform the registration of the COM component for you. But it will also give you the opportunity to register the object yourself.

The Twitter Toolkit package consists of 3 components; any combination of components can be installed:

  • The Twitter Toolkit COM component
  • The Twitter Toolkit Help Files
  • The Twitter Toolkit Sample Files

The COM component, which is the interface to COM compliant applications, includes a 32 bit dll (TwitterTk.dll) and 64 bit dll (TwitterTkx64.dll)

4. How to use

4.1. Introduction

The following code snippets (VBScript) illustrate the use of the ActiveXperts Twitter Toolkit in various situations. Consumer token and secret as well as access token and secret are substituted by rows of dots ('.'). To use the samples obtain a consumer key with Twitter here.

The following sample shows how to Authorize on Twitter and send a Tweet. For more information about OAuth in the Twitter Toolkit click here. Try our consumer and access key wizard to create your own consumer key and access key.

Authorize and send a Tweet

  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

List your home time-line

  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

List your followers

  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

Make a custom API call

  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

4.2. Visual Basic .NET

Add a reference to the Twitter Toolkit object using the Visual C# Solution Explorer:

  • Start the Solution Provider, go to the project's 'References' container
  • Choose 'Add Reference' from the context menu
  • Select the COM tab, choose the 'ActiveXperts Twitter Toolkit' component

You can use different Twitter objects in one Visual C# .NET application. The following code shows how to declare and create the Twitter objects:

  using TwitterTKLib

  Dim objTwitter As Twitter ;                 // Declaration
  objTwitter = new Twitter();                 // Creation

  Dim objTweet As Tweet ;                     // Declaration
  objTweet = new Tweet();                     // Creation

  Dim objUser As User ;                       // Declaration
  objUser = new User();                       // Creation

4.3. Visual C# .NET

Add a reference to the Twitter Toolkit object using the Visual C# Solution Explorer:

  • Start the Solution Provider, go to the project's 'References' container
  • Choose 'Add Reference' from the context menu
  • Select the COM tab, choose the 'ActiveXperts Twitter Toolkit' component

You can use different Twitter objects in one Visual C# .NET application. The following code shows how to declare and create the Twitter objects:

  using TwitterTKLib

  Twitter objTwitter;                         // Declaration
  objTwitter = new Twitter ();                // Creation

  Tweet objTweet;                             // Declaration
  objTweet = new Tweet();                     // Creation

  User objUser;                               // Declaration
  objUser = new User();                       // Creation

4.4. Visual Basic

Twitter Toolkit can be used in Visual Basic 5.x or higher. In Visual Basic, go to the 'Project/References...' menu item and check the box next to Twitter Toolkit Type Library. Now, you can declare and create Twitter Toolkit objects.

Create new Twitter Toolkit objects using the 'CreateObject' function:

  Dim objTwitter As TwitterTKLib.Twitter                        ' Declaration
  Set objTwitter = CreateObject("ActiveXperts.Twitter")         ' Creation

  Dim objTweet As TwitterTKLib.Tweet                            ' Declaration
  Set objTweet = CreateObject( "ActiveXperts.Twitter.Tweet" )   ' Creation
  
  Dim objUser  As TwitterTKLib.User                             ' Declaration
  Set objUser = CreateObject( "ActiveXperts.Twitter.User")      ' Creation

4.5. Visual C++

The Twitter Toolkit can be used in Visual C++ projects. Include the *.h and *.c file provided by ActiveXperts to bind your code to the Twitter Toolkit component. These files are located in the Include directory of the Visual C++ samples directory. These are the files:

  • twittertk.h
  • twittertk_i.c

Declare and create new Twitter Toolkit objects like this:

  ITwitter *pTwitter;              
  CoCreateInstance(CLSID_Twitter, NULL, CLSCTX_INPROC_SERVER, IID_ITwitter, (void**) &Twitter ); 
    
  ITweet *pTweet;
  CoCreateInstance(CLSID_Tweet, NULL, CLSCTX_INPROC_SERVER, IID_ITweet, (void**) &pTweet );

  IUser *pUser;              
  CoCreateInstance(CLSID_User, NULL, CLSCTX_INPROC_SERVER, IID_IUser, (void**) &pUser );

4.6. ASP Classic

  <html>
  <body>
  Version:
  <script language="vbscript" runat="server">
    Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
    Set objTweet = CreateObject( "ActiveXperts.Twitter.Tweet" )
    Set objUser = CreateObject( "ActiveXperts.Twitter.User" )
    Response.Write objTwitter.Version
  </script>
  </body>
  </html>

4.7. Delphi 7.x or higher

First, add a reference to the Twitter Toolkit objects:

  • Go to Project->Import Type Library
  • Select 'ActiveXperts Twitter Toolkit Type Library'
  • Click 'Install'
  • The project 'dclusr.dpk' will be opened. Click 'Yes'
  • You can now use the Twitter Toolkit toolkit within your application by selecting the component from the 'ActiveX' component bar.
  objTwitter  : ITwitter;                                   { Declaration of the interface class  }
  objTwitter  := TTwitter.Create(Form1).DefaultInterface;   { Creation new instance of the object }

  objTweet    : ITweet;                                     { Declaration of the interface class  }
  objTweet    := TTweet.Create(Form1).DefaultInterface;     { Creation new instance of the object }
  
  objUser     : IUser;                                      { Declaration of the interface class  }
  objUser     := TUser.Create(Form1).DefaultInterface;      { Creation new instance of the object }

5. API Reference

5.1. Introduction

The ActiveXperts Twitter Toolkit API defines an interface to Twitters REST API. At one hand it provides an easy and intuitive interface which serves as a transparent abstraction over the Twitter API and on the other hand it provides a method to call Twitter API functions directly, while automatically signing the calls, which ensures compatibility with future extensions of the Twitter REST API.

OAuth authorization is completely integrated to the point where only two function call are needed to authenticate a user for either web or the client use-cases. This also enables you to have custom calls to the Twitter REST API automatically signed according to the given credentials.

Find more information about how to authorize on Twitter using the Twitter Toolkit in the Introduction of the How to use section. Try our consumer and access key wizard to create your own consumer key and access key.

5.2. Twitter

Properties

Property Type Description
Version String Version number of the Twitter Toolkit
Build String Build number of the Twitter Toolkit
Module String Module name of the Twitter Toolkit
ExpirationDate String Expiration date of the Twitter Toolkit
LastError Number Result of the last called method
LogFile String The path to a logfile which can be used for troubleshooting
ConsumerKey String The consumer key needed to connect to Twitter.
ConsumerSecret String The consumer secret needed to connect to Twitter
AccessToken String The access token needed to authorize a specific user
AccessTokenSecret String The access token secret needed to authorize as specific user
ProxyServer String Proxy server name if this is needed in your internet configuration
ProxyAccount String Proxy account to authenticate to the proxy server
ProxyPassword String Proxy password to authenticate to the proxy server
HttpLibrary String The path to an alternative version of the WinHTTP library if needed.
UserSSL Boolean Switch to using an SSL based (https) connection to Twitter

Functions

Function Description
Activate Activate the product
Clear Reset all properties to their default values
GetErrorDescription Get the description of the given error
RequestAuthorization Returns the URL where the user can authenticate this application
RequestAccessToken Requests an access token in return for the users verification number
Tweet Post a short message on Twitter
DirectTweet Post a direct message on Twitter
Follow Follow another Twitter user
UnFollow UnFollow another Twitter user
FindFirstStatus Find the first status message (Tweet) of a specific timeline or user
FindNextStatus Find the next status message for the specified timeline or user
FindFirstFollower Find your first follower or the first follower for a specific user
FindFirstFriend Find your first friend or the first friend for a specific user
FindFirstUser Find the first user that meets the given search criteria
FindNextUser Find the next user. Works for FindFirstFriend, FindFirstFollower and FindFirstUser
APICall Send a custom API call to the Twitter REST API
SaveAccessKey Save the access key and secret to a file
SaveConsumerKey Save the consumer key and secret to a file
LoadAccessKey Load an access key and secret from file
LoadConsumerKey Load a consumer key and secret from file

Version property

Return the version number of the Twitter Toolkit.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  Wscript.Echo "Twitter Toolkit Version " & objTwitter.Version & "; Build " & _
    objTwitter.Build & "; Module " & objTwitter.Module
  WScript.Echo "Expiration date: " & objTwitter.ExpirationDate & vbCrLf
  ...

Build property

Return the build number of the Twitter Toolkit.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  Wscript.Echo "Twitter Toolkit Version " & objTwitter.Version & "; Build " & _
    objTwitter.Build & "; Module " & objTwitter.Module
  WScript.Echo "Expiration date: " & objTwitter.ExpirationDate & vbCrLf
  ...

Module property

Return the module name of the Twitter Toolkit.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  Wscript.Echo "Twitter Toolkit Version " & objTwitter.Version & "; Build " & _
    objTwitter.Build & "; Module " & objTwitter.Module
  WScript.Echo "Expiration date: " & objTwitter.ExpirationDate & vbCrLf
  ...

ExpirationDate property

Return the expiration date of the Twitter Toolkit.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  Wscript.Echo "Twitter Toolkit Version " & objTwitter.Version & "; Build " & _
    objTwitter.Build & "; Module " & objTwitter.Module
  WScript.Echo "Expiration date: " & objTwitter.ExpirationDate & vbCrLf
  ...

LastError property

Completion code of the last called function. To find the error description of a given error code, go to the online error codes codes page.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )  
  ...  
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again." 
  WScript.Echo "Tweet, result: " &  objTwitter.LastError    ' Was our Tweet accepted ?  
  ...

LogFile property

By default, LogFile holds an empty string and nothing is logged. If a valid file name is assigned to it, the Twitter Toolkit will write debug information to this file. Output data is written at the end of the file, the file is not cleared.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  objTwitter.LogFile = "C:\temp\log.txt"
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  

ConsumerKey property

Set the consumer key. To be able to connect to twitter through it's HTTP interface your application needs to be registered with Twitter.

When your application is registered with Twitter you will receive a consumer key and a consumer secret. The combination of these keys is needed to identify your application with the Twitter service.

To register your application with Twitter click here and login.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) 
  ...
  objTwitter.ConsumerKey = "..................."                            
  objTwitter.ConsumerSecret = ".........................................."
  ...

ConsumerSecret property

Set the consumer secret. To be able to connect to twitter through it's HTTP interface your application needs to be registered with Twitter.

When your application is registered with Twitter you will receive a consumer key and a consumer secret. The combination of these keys is needed to identify your application with the Twitter service.

To register your application with Twitter click here and login.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) 
  ...
  objTwitter.ConsumerKey = "..................."                            
  objTwitter.ConsumerSecret = ".........................................."
  ...

AccessToken property

Set the access token to authorize a specific user.

An application will be authorized by a user and is given an access token and access token secret combination. These are valid until the user chooses to revoke the authorization using the Twitter web interface.

More information about access tokens look at the RequestAuthorization and the RequestAccessToken functions. A global description can be found in the Introduction of the 'How to use' section.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) 
  ...
  objTwitter.AccessToken = ".........-........................................"
  objTwitter.AccessTokenSecret = ".........................................."
  ...

AccessTokenSecret property

Set the access token secret to authorize a specific user.

An application will be authorized by a user and is given an access token and access token secret combination. These are valid until the user chooses to revoke the authorization using the Twitter web interface.

More information about access tokens look at the RequestAuthorization and the RequestAccessToken functions. A global description can be found in the Introduction of the 'How to use' section.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" ) 
  ...
  objTwitter.AccessToken = ".........-........................................"
  objTwitter.AccessTokenSecret = ".........................................."
  ...

ProxyServer property

Set this to the proxy server name if your internet configuration requires access to the internet through a proxy server.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.ProxyServer = "http://192.168.31.18:3128"
  objTwitter.ProxyAccount = "Jane"
  objTwitter.ProxyPassword = "password"
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

ProxyAccount property

Set this to your proxy server account name if your internet configuration requires access to the internet through a proxy server.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.ProxyServer = "http://192.168.31.18:3128"
  objTwitter.ProxyAccount = "Jane"
  objTwitter.ProxyPassword = "password"
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

ProxyPassword property

Set this to your proxy server account password if your internet configuration requires access to the internet through a proxy server.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.ProxyServer = "http://192.168.31.18:3128"
  objTwitter.ProxyAccount = "Jane"
  objTwitter.ProxyPassword = "password"
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

HttpLibrary property

If the Twitter Toolkit is having problems finding the WinHTTP library this property can be used to set the path to a specific WinHTTP library version.

On most installations you do not need to set this property.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.HttpLibrary = "C:\Program Files\Common Files\ActiveXperts\WINHTTP5.DLL"
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

UserSSL property

Switches the Twitter Toolkit to using the SSL based Twitter URLs (https://api.twitter.com/)

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.UseSSL = True
  ...
  objTwitter.Tweet "Just (securely) Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

Activate function

This function activates the Twitter Toolkit product. A valid registration code should be passed as parameter.

Parameters:

  • The registration key
  • Persistent - this optional Boolean variable (default: True) specifies whether you want to add the registration key to the registry. If you pass 'True', you need to call the 'Activate' function only once for that computer. If you pass 'False', you need to call 'Activate' each time you create the object on that computer. This can be useful for customers who own a Distribution License of the product but do not want to show the registration key to their customers (see also here).

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
            
  objTwitter.Activate "xxxxx-xxxxx-xxxxx", True
  ...

Clear function

This function resets all properties to their default values.

Parameters:

  • None

Return value:

Always 0.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ....
  objTwitter.Clear
  ...

GetErrorDescription function

GetErrorDescription provides the error description of a given error code.

Parameters:

  • The error code

Return value:

The error string.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
            
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  WScript.Echo "Tweet result: " & objTwitter.LastError & ", " & _
    objTwitter.GetErrorDescription(objTwitter.LastError)

RequestAuthorization function

This is the first method to be called when requesting an access token. This function returns an URL which contains all of the information needed for Twitter to let the user authenticate the calling application.

When the user is redirected to this URL the user is asked for his/her name and password and when correctly identified can either grant or deny access for your application on his behalf.

If the user grants access the user if presented with either a verification code, if client authorization was chosen. Or the user will be redirected to a page in your web application if web authorization was chosen.

Parameters:

  • (Optional) The callback URL. By leaving this parameter blank 'client' authentication is chosen and the user is presented with a verification key. If this property is filled web authentication is chosen and the user will be redirected to this URL. In web authentication the verification key is send as a parameter on the callback.

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
            
  objTwitter.ConsumerKey = "..................."
  objTwitter.ConsumerSecret = ".........................................."

  strUrl = objTwitter.RequestAuthorization 
  Navigate strUrl

  ' While on the Authorization URL, ask the user to input the verification code
  strVerify = inputbox( "Enter verification code", "Enter value", "" )

  objTwitter.RequestAccessToken strVerify

  ' Tweet about our success !
  objTwitter.Tweet "I have authorized my application using the ActiveXperts Twitter Toolkit !"

  ...

RequestAccessToken function

This function requests an access token for the verification code. Obtain the verification code by calling RequestAuthorization.

The access token and the access token secret will be stored in the AccessToken and AccessTokenSecret properties. This way you can immediately continue calling methods that require authentication. Print or otherwise safe these properties to save the access token and access token secret.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
            
  objTwitter.ConsumerKey = "..................."
  objTwitter.ConsumerSecret = ".........................................."

  strUrl = objTwitter.RequestAuthorization 
  Navigate strUrl

  ' While on the Authorization URL, ask the user to input the verification code
  strVerify = inputbox( "Enter verification code", "Enter value", "" )

  objTwitter.RequestAccessToken strVerify

  ' Tweet about our success !
  objTwitter.Tweet "I have authorized my application using the ActiveXperts Twitter Toolkit !"

  ...

Tweet function

Post a Tweet (Status update) on Twitter. You can post a direct message by prefixing the message with '@<username>'. Messages can be 140 characters long.

Parameters:

  • The message to Tweet

Return value:

Returns the new Tweet ID. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

DirectTweet function

Post a direct Tweet to a user or a specific Tweet from a user on Twitter. Messages can be 140 characters long.

Parameters:

  • The message to Tweet
  • The user to Tweet to
  • (Optional) The status ID to reply to

Return value:

Returns the new Tweet ID. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.Tweet "Just Tweeting about the ActiveXperts Twitter Toolkit again."
  ...

Follow function

Follow another Twitter users.

Parameters:

  • UserId. This can either be the user id or a users screen name.

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.Follow "ActiveXperts"
  ...

UnFollow function

UnFollow a Twitter user you are currently following

Parameters:

  • UserId. This can either be the user id or a users screen name

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.UnFollow "ActiveXperts"
  ...

FindFirstStatus function

Find the first status message in the specified timeline. The timeline can be any of "public", "home", "friends", "mentions", "retweeted_by_me", "retweeted_to_me", "retweeted_of_me" or either a user id or screen name.

If the timeline is "public" all other arguments will be ignored. If the timeline is of a user that is has not protected its profile you do not need an access token and access token secret.

Use the FindFirstStatus function before calling FindNextStatus to collect all status messages in a certain timeline. The FindFirstStatus function will get all of the status messages and return the first. FindNextStatus get be used to iterate over all of them.

Parameters:

  • Timeline. The timeline you want to see.
  • (Optional) SinceId. The first status id, where the timeline should start
  • (Optional) MaxId. The last status id, where the timeline should stop
  • (Optional) lCount. The maximum number of statuses per page
  • (Optional) lPage. The page number you want to get.

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.Status object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "--"
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd
  ...

FindNextStatus function

Find the next status message for the specified timeline or user. Use the FindFirstStatus function to get the timeline before using FindNextStatus.

Parameters:

  • None

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.Status object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "--"
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd
  ...

FindFirstFollower function

Finds your first follower or the first follower for a specific user. You must call this function before calling FindNextUser to iterate over all followers.

Parameters:

  • (Optional) User Id. To find your own followers leave this parameter empty. This can either be a user id or a screen name

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.User object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objUser = objTwitter.FindFirstFollower
  While objTwitter.LastError = 0
    WScript.Echo "---"
    WScript.Echo "Id: " & objUser.Id
    WScript.Echo "Name: " & objUser.Name
    WScript.Echo "Screen name: " & objUser.ScreenName
    WScript.Echo "Description: " & objUser.Description
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

FindFirstFriend function

Finds your first friend or the first friend for a specific user. You must call this function before calling FindNextUser to iterate over all friends.

Parameters:

  • (Optional) User Id. To find your own friend leave this parameter empty. This can either be a user id or a screen name

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.User object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objUser = objTwitter.FindFirstFriend
  While objTwitter.LastError = 0
    WScript.Echo "---"
    WScript.Echo "Id: " & objUser.Id
    WScript.Echo "Name: " & objUser.Name
    WScript.Echo "Screen name: " & objUser.ScreenName
    WScript.Echo "Description: " & objUser.Description
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

FindFirstUser function

Find the first user that meets the given search criteria. You must call this function before calling FindNextUser to iterate over all users.

Parameters:

  • Query. The search query to execute
  • (Optional) The number of users to return per page.
  • (Optional) The page number.

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.User object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objUser = objTwitter.FindFirstUser "Active"
  While objTwitter.LastError = 0
    WScript.Echo "---"
    WScript.Echo "Id: " & objUser.Id
    WScript.Echo "Name: " & objUser.Name
    WScript.Echo "Screen name: " & objUser.ScreenName
    WScript.Echo "Description: " & objUser.Description
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

FindNextUser function

Find the next user. Works for FindFirstFriend, FindFirstUser and FindNextUser. Before calling this function a set of results should be prepared by calling either FindFirstFriend, FindFirstFollower or FindFirstUser

Parameters:

  • None

Return value:

If the function completed successfully it returns an ActiveXperts.Twitter.User object. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objUser = objTwitter.FindFirstUser "Active"
  While objTwitter.LastError = 0
    WScript.Echo "---"
    WScript.Echo "Id: " & objUser.Id
    WScript.Echo "Name: " & objUser.Name
    WScript.Echo "Screen name: " & objUser.ScreenName
    WScript.Echo "Description: " & objUser.Description
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

APICall function

Sends a custom API call to the Twitter REST API. If there is an access token and access token secret available the request will be automatically signed.

To find out which method can be called you can check out the Twitter API here

Parameters:

  • Method. The name of the method to call
  • Format. The format you need the result in
  • (Optional) Parameters. The parameters need to be formatted as a POST string
  • (Optional) UsePost. Boolean value which specifies whether to use the HTTP Post or HTTP Get method

Return value:

If the function succeeded it returns the response body of the HTTP API call. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  Set objXML = CreateObject( "Microsoft.XMLDOM" )
  ...
  strResult = objTwitter.APICall("statuses/home_timeline", "xml")

  'Display the home timeline
  objXML.LoadXML(strResult)
  Set objNodeList = objXML.selectNodes("//statuses/status/text")
  For i = 0 To objNodeList.length
    WScript.Echo objNodeList(i).text
  Next  
  ...

SaveAccessKey function

Saves the current access key and secret to a file.

Parameters:

  • The target filename

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.SaveConsumerKey "C:\Temp\Consumer.key"
  objTwitter.SaveAccessKey "C:\Temp\Access.key"
  ...

SaveConsumerKey function

Saves the current consumer key and secret to a file.

Parameters:

  • The filename

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.SaveConsumerKey "C:\Temp\Consumer.key"
  objTwitter.SaveAccessKey "C:\Temp\Access.key"
  ...

LoadAccessKey function

Loads an access key and secret from a file and sets it as the current access key and secret.

Parameters:

  • The filename

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.LoadConsumerKey "C:\Temp\Consumer.key"
  objTwitter.LoadAccessKey "C:\Temp\Access.key"
  ...
  objTwitter.Tweet "I'm tweeting this using the ActiveXperts Twitter Toolkit !"
  ...

LoadConsumerKey function

Loads an consumer key and secret from a file and sets it as the current consumer key and secret.

Parameters:

  • The target filename

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:
  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  objTwitter.LoadConsumerKey "C:\Temp\Consumer.key"
  objTwitter.LoadAccessKey "C:\Temp\Access.key"
  ...
  objTwitter.Tweet "I'm tweeting this using the ActiveXperts Twitter Toolkit !"
  ...

5.3. Twitter.Status

Properties

Property Type Description
CreatedAt String Time at which this Tweet was created
Id String The Id of this Tweet
Text String The contents
Source String The application that posted this Tweet
User String The user that posted this Tweet
XML String The XML representation of this Tweet

CreatedAt property

The time at which this Tweet was created

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

Id property

The Id of this Tweet

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

Text property

The message contained in this Tweet

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

Source property

The application which posted this Tweet

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

User property

The user that posted this Tweet

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

XML property

The XML representation of this Tweet

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  Set objStatus = objTwitter.FindFirstStatus("home")
  While objTwitter.LastError = 0
    WScript.Echo "Id: " & objStatus.Id
    WScript.Echo "Created at: " & objStatus.CreatedAt
    WScript.Echo "Text: " & objStatus.Text
    WScript.Echo "Source: " & objStatus.Source
    WScript.Echo "XML: "
    WScript objStatus.Source
    Set objStatus = objTwitter.FindNextStatus
  WEnd  
  ...

5.4. Twitter.User

Properties

Property Type Description
Id String The user id
Name String The user name
ScreenName String The screen name
Location String The users location
Description String The users description
ProfileImage String The users profile image URL
Url String The users URL
Protected Boolean Whether a user is protected or not
NumFollowers Number The number of follower
NumFriends Number The number of friends
NumStatuses Number The number of status updates (Tweets)
CreatedAt Number The creation date for this user
XML Number The XML representation of this user

Id property

The user id.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

Name property

The user name.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

ScreenName property

The screen name.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

Location property

The users location.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

Description property

The user description.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

ProfileImage property

The user profile image URL.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

Url property

The users URL.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

Protected property

Whether the user is protected or not.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

NumFollowers property

The number of followers.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

NumFriends property

The number of friends

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

NumStatuses property

The number of status updates.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

CreatedAt property

The creation date for this user.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

XML property

The XML representation of this user.

Example:

  Set objTwitter = CreateObject( "ActiveXperts.Twitter" )
  ...
  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 "Statuses: " & objUser.NumStatuses
    WScript.Echo "XML:"
    WScript.Echo objUser.XML
    Set objUser = objTwitter.FindNextUser
  Wend
  ...

6. Error codes

6.1. Error codes

When a function is called, the result of the function is stored in the object's 'LastError' property. When 'LastError' is 0, it means that the last called function completed successfully; otherwise, an error occurred.

The value of the LastError tells you why the function failed. All error codes are listed on the ActiveXperts web site, here.

Alternatively, the 'GetErrorDescription' function can be used to find the error description for a given error code.

7. Support

7.1. Product samples

Samples for Visual Basic, Visual Basic .NET, Visual C++, Visual C# .NET, ASP and VBScript are included as part of the installation.

7.2. ActiveXperts support

Visit the ActiveXperts Support Site for a complete list of FAQ items at: http://www.activexperts.com/support

To contact support, please send an e-mail to: support@activexperts.com

8. Purchase and activation

8.1. Purchase

Please visit www.activexperts.com/sales to buy the product. Here, you can also find the latest prices. You can also contact us via email: sales@activexperts.com

8.2. Product Activation

After you purchase the product, you will receive a registration code. This code must be entered in the registry on your machine(s). There are three ways to accomplish this:

1. Automatic installation

The Twitter Toolkit automatic installation performs all necessary steps to install and register the component. It will ask for the registration code during installation and will enter the registration code in the registry.

2. 'Activate' function

You can use the Activate function.

Set objTwitter = CreateObject("ActiveXperts.Twitter ")
objTwitter.Activate XXXXX-XXXXX-XXXXX", True ' 'XXXXX-XXXXX-XXXXX' represents the registration code
                     ' Pass True to make the activation persistent, so you need to
                     ' call Activate only once. If you pass False, you need to call Activate
                     ' each time the product is started.

The Activate function of any of the objects writes the following entry to the registry, which will actually activate the product:

    Key: HKEY_LOCAL_MACHINE\Software\ActiveXperts\Twitter Toolkit\RegistrationKey  
    Type: REG_SZ  Value: XXXXX-XXXXX-XXXXX

where 'XXXXX-XXXXX-XXXXX' is the registration code issued to you.

3. Manually insert code in the registry

You can activate the product by editing the registry manually:

  • Start the registry editor (either REGEDT32.EXE or REGEDIT.EXE);
  • Open the 'HKEY_LOCAL_MACHINE\Software\ActiveXperts\Twitter Toolkit' key;
  • Add/modify the 'RegistrationKey' value: Type: REG_SZ, Value: XXXXX-XXXXX-XXXXX

Distribution License

For information about how to use the registration code with a Distribution License, please read the following document: How to distribute an ActiveXperts Toolkit.

Appendix A License Agreement

  PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY BEFORE 
  DOWNLOADING OR USING THE SOFTWARE.  BY CLICKING ON THE 
  "ACCEPT" BUTTON, OPENING THE PACKAGE, DOWNLOADING THE PRODUCT, 
  OR USING THE EQUIPMENT THAT CONTAINS THIS PRODUCT, YOU ARE 
  CONSENTING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE 
  TO ALL OF THE TERMS OF THIS AGREEMENT, CLICK THE "DO NOT 
  ACCEPT" BUTTON AND THE INSTALLATION PROCESS WILL NOT CONTINUE, 
  RETURN THE PRODUCT TO THE PLACE OF PURCHASE FOR A FULL REFUND, 
  OR DO NOT DOWNLOAD THE PRODUCT.
  
  GENERAL
  In this Software License Agreement:
  (i) "ActiveXperts" means ActiveXperts Software B.V.
  (ii) "Customer" means the individual(s), organization or business entity 
  buying a license of the Software from ActiveXperts or its Distributors 
  or its Resellers.
  (iii) "Software" means computer programs (and their storage medium) 
  supplied by ActiveXperts and known collectively as "Twitter Toolkit" 
  in which ActiveXperts has property rights and any user manuals, 
  operating instructions, brochures and all other documentation relating 
  to the said computer programs (the expression "Software" to include all 
  or any part or any combination of Software).
  
  1. LICENSE GRANT
  ActiveXperts grants Customer the following rights provided that you 
  comply with all terms and conditions of this License Agreement:
  
  (a) Installation and use. Customer may install, use, access, display and 
  run one copy of the Software on a single computer, such as a 
  workstation, terminal or other device ("Workstation Computer"). A 
  "License Pack" allows you to install, use, access, display and run 
  additional copies of the Software up to the number of "Licensed Copies" 
  specified above.
  
  (b) Reservation of Rights. ActiveXperts reserves all rights not 
  expressly granted to you in this License Agreement.
  
  2. UPGRADES AND SUPPLEMENTS
  To use a product identified as an upgrade, you must first be licensed 
  for the Software as eligible for the upgrade. After upgrading, Customer 
  may no longer use the product that formed the basis for Customer's 
  upgrade eligibility.
  
  This License Agreement applies to updates or supplements to the original 
  Software provided by ActiveXperts, unless we provide other terms along 
  with the update or supplement.
  
  3. LIMITATION ON REVERSE ENGINEERING,DECOMPILATION, AND DISASSEMBLY
  Customer may not reverse engineer, decompile, or disassemble the 
  Software, except and only to the extent that it is expressly permitted 
  by applicable law notwithstanding this limitation.
  
  4. TERMINATION
  Without prejudice to any other rights, ActiveXperts may cancel this 
  License Agreement if Customer does not abide by the terms and conditions 
  of this License Agreement, in which case you must destroy all copies of 
  the Software and all of its component parts.
  
  5. NOT FOR RESALE SOFTWARE
  Software identified as "Not for Resale" or "NFR," may not be resold, 
  transferred or used for any purpose other than demonstration, test or 
  evaluation.
  
  6. LIMITED WARRANTY
  ActiveXperts warrants that for a period of ninety (90) days from the 
  date of shipment from ActiveXperts: (i) the media on which the Software 
  is furnished will be free of defects in materials and workmanship under 
  normal use; and (ii) the Software substantially conforms to its 
  published specifications. Except for the foregoing, the Software is 
  provided AS IS. This limited warranty extends only to Customer as the 
  original licensee. Customer's exclusive remedy and the entire liability 
  of ActiveXperts and its suppliers under this limited warranty will be, 
  at ActiveXperts or its service center's option, repair, replacement, or 
  refund of the Software if reported (or, upon request, returned) to the 
  party supplying the Software to Customer. In no event does ActiveXperts 
  warrant that the Software is error free or that Customer will be able to 
  operate the Software without problems or interruptions.
  This warranty does not apply if the software (a) has been altered, 
  except by ActiveXperts, (b) has not been installed, operated, repaired, 
  or maintained in accordance with instructions supplied by ActiveXperts, 
  (c) has been subjected to abnormal physical or electrical stress, 
  misuse, negligence, or accident, or (d) is used in ultrahazardous 
  activities.
  
  
  7. LIMITATION OF LIABILITY AND REMEDIES.
  Notwithstanding any damages that you might incur for any reason 
  whatsoever (including, without limitation, all damages referenced above 
  and all direct or general damages), the entire liability of ActiveXperts 
  and any of its suppliers under any provision of this License Agreement 
  and your exclusive remedy for all of the foregoing (except for any 
  remedy of repair or replacement elected by ActiveXperts with respect to 
  any breach of the Limited Warranty) shall be limited to the greater of 
  the amount actually paid by you for the Software or U.S.$5.00. The 
  foregoing limitations, exclusions and disclaimers (including Sections 4, 
  5 and 6 above) shall apply to the maximum extent permitted by applicable 
  law, even if any remedy fails its essential purpose.
  
  8. ENTIRE AGREEMENT
  
  This License Agreement (including any addendum or amendment to this 
  License Agreements which is included with the Software) are the entire 
  agreement between you and ActiveXperts relating to the Software and the 
  support services (if any) and they supersede all prior or 
  contemporaneous oral or written communications, proposals and 
  representations with respect to the Software or any other subject matter 
  covered by this License Agreement. To the extent the terms of any 
  ActiveXperts policies or programs for support services conflict with the 
  terms of this License Agreement, the terms of this License Agreement 
  shall control.
  
  This Agreement shall be construed in accordance with the laws of The 
  Netherlands and the Dutch courts shall have sole jurisdiction in any 
  dispute relating to these conditions. If any part of these conditions 
  shall be or become invalid or unenforceable in any way and to any extent 
  by any existing or future rule of law, order, statute or regulation 
  applicable thereto, then the same shall to the extent of such invalidity 
  or enforceability be deemed to have been deleted from the conditions 
  which shall remain in full force and effect as regards all other 
  provisions.
  
  9. Copyright
  The Software is protected by copyright and other intellectual property 
  laws and treaties. ActiveXperts or its suppliers own the title, 
  copyright, and other intellectual property rights in the Software. The 
  Software is licensed, not sold.