ActiveXperts Twitter Toolkit Add Twitter capabilities to any Windows or .NET application

Quicklinks


How to use ActiveXperts Twitter Toolkit with Visual Basic .NET

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 have the option of using Twitters HTTP based RESTfull API. The ActiveXperts Twitter Toolkit provides a user friendly wrapper around Twitters own HTTP based API.

The ActiveXperts Twitter API 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 both Client and Web use cases
  • Authenticate users in only two steps
  • Access all of the functions that are publicly available on the Twittter HTTP interface
  • Proved an interface to send custom, OAuth signed, requests to the Twitter HTTP interface

This tutorial describes how the Twitter Toolkit can be integrated in Visual Basic .NET projects.

Step 1: Download and install the ActiveXperts Twitter Toolkit

Download the Twitter Toolkit from the ActiveXperts web site and start the installation. The installation guides you through the installation process.  Download now »

Step 2: Create a new script

Create a new script using your favorite editor. You can simply use notepad. However, a VBScript editor is recommended, so you can browse through objects, objects properties and object functions.

You're now able to write a more advanced script to communicate using the ActiveXperts Twitter Toolkit.

Step 3: Create the Twitter Toolkit object in VBScript

Create a new VBScript file called DEMO.VBS. It is recommended to insert the following line on top of your code:

Option Explicit

This statement requires that all variable names be defined (with the Dim statement), to avoid simple typos that can cause incredible headaches and long debugging sessions for something that should have never happened.

Now, declare the Twitter Toolkit object:

Dim objTwitter

Create the Twitter Toolkit object like this:

Set objTwitter      = CreateObject( "ActiveXperts.Twitter" )

Now, add the following lines to the file to have your fist Twitter Toolkit VBScript program:

WScript.Echo "Version: " & objTwitter.Version
WScript.Echo "Expiration Date: " & objTwitter.Expiration Date

Step 5: Tweet a message

The following code shows how to tweet a message using ASP

Option Explicit

Dim objTwitter, strConsumerKey, strAccessKey

' Create the twitter object
Set objTwitter = CreateObject( "ActiveXperts.Twitter" )

' Write some information to console
Wscript.Echo "Twitter Toolkit Version " & objTwitter.Version 

' Set consumer key file and access key file
strConsumerKey = "C:\Consumer.key"
strAccessKey   = "C:\Access.key"

' Load consumer key file
objTwitter.LoadConsumerKey strConsumerKey
WScript.Echo "LoadConsumerKey, result: " &  objTwitter.LastError

objTwitter.LoadAccessKey strAccessKey
WScript.Echo "LoadAccessKey, result: " &  objTwitter.LastError

' Tweet
objTwitter.Tweet "I'm tweeting using the ActiveXperts Twitter Toolkit."
WScript.Echo "Tweet, result: " &  objTwitter.LastError

Samples

There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/twitter-component


Support Operating Systems

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)