You are here:
ActiveXperts.com > Twitter Toolkit > How to Use ActiveXperts Twitter Toolkit > Visual Basic .NET
Quicklinks
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:
This tutorial describes how the Twitter Toolkit can be integrated in Visual Basic .NET projects.
Download the Twitter Toolkit from the ActiveXperts web site and start the installation. The installation guides you through the installation process. Download now »
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.
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
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
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
The Twitter Toolkit can be used by any of the following operating systems: