Archive for November, 2010

How I Created my own Twitter App with Visual Basic

Over the past few weeks, I have spent countless hours programming (and testing and reprogramming and testing and reprogramming, etc.) a Twitter app I created in Visual Basic.  It was the most fun project I could think of for a Visual Basic class I’m taking at UNLV.  In the end, the programming wasn’t so difficult.  It just took me a long time to find something that worked.  After many Google searches, I couldn’t find a straight-forward walkthrough, so hopefully this blog post will be helpful to some lost soul out there (maybe for another school project).  Below is a screen shot of my app.

Twitter App Created with Visual Basic

The only action my form does with Twitter is post an update when the “to Twitter” checkbox is checked.  The other buttons read, write, edit and delete tweets in a Microsoft Access database. First, I created the form above, including the labels, text boxes, and buttons.  I won’t go into the code behind each one of them, but the code for the label with the number of characters remaining was particularly fun to write.  I made its actions similar to what is on Twitter’s webpage.  When the number of characters in the status text box (rtbStatus) goes over 140, the text turns red and the “tweet” button is disabled.  The code is:

Private Sub rtbStatus_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtbStatus.TextChanged lblTweetLength.Text = 140 – rtbStatus.TextLength If lblTweetLength.Text < 0 Then lblTweetLength.ForeColor = Color.Red End If If rtbStatus.TextLength = 0 Or rtbStatus.TextLength > 140 Then btnTweetToDatabase.Enabled = False Else btnTweetToDatabase.Enabled = True End If End Sub

Next, I went to the Twitter Developers webpage and registered my application (funny, I never thought I’d be a Twitter developer).  After filling out a form describing my app, I received a consumer key, consumer secret, access token, and access token secret.  These are needed to authorize your application to access your Twitter account. Then, I went to the TwitterVB webpage, which is an open source project with a .NET library that allows desktop and web applications to communicate with Twitter.  I downloaded the TwitterVB zip file.  The zip file contains many different files, but the only one I used was TwitterVB.dll.  In Visual Basic, I added the dll file as a reference. I included the namespace in my code file with the following:

Imports TwitterVB2

I then added the following code that I found from the TwitterVB webpage to the code that executes when the “tweet” button is clicked and the “to Twitter” checkbox is checked.  I replaced the consumer key, consumer secret, access token, and access token secret in the code with what I had received from the Twitter Developers webpage when I registered my application.

Dim TextToTweet As String TextToTweet=rtbStatus.Text Dim tw As New TwitterVB2.TwitterAPI tw.AuthenticateWith(“consumerkey”,“consumersecret”,“oauthtoken”,“tokensecret”) tw.Update(TextToTweet)

Then, I tested my app.

Testing my Twitter App

After I clicked the “tweet” button, I opened my Twitter timeline in my web browser and saw that my tweet successfully posted to Twitter!  It even shows that it posted via DustinVB, which is what I named my app when I registered it with Twitter.

My Test Tweet in a Web Browser

After I turn this project in to be graded, it will collect dust in my virtual bookshelf.  I don’t plan to use it again.  There are so many good Twitter programs out there that can do so much more than mine can. Still, I feel happy that I figured it out and can now call myself a Twitter developer (even though I’m a novice, at best).

Tweets on the Big Screen at the Growth and Profitability Summit

A few months ago in a blog post, I tried to answer the question, “why would a CPA want to use Twitter?” After attending Accounting Today’s Growth & Profitability Summit, I have another reason for a CPA to use Twitter.  Twitter is awesome at conferences! By adding the hashtag #GroPro (short for Growth & Profitability) to my tweets, I shared useful quotes with others at the conference.  I also added a column to my Tweetdeck Droid app using a search for #GroPro and was able to follow what other people were tweeting at the conference. In a conference setting, Twitter provides opportunities to share useful information and connect with others.  I was able to meet several people (in person) that I had followed on Twitter during the conference.  Twitter just breaks the ice.  I wasn’t disappointed – all of the people I met were just as cool as their tweets! Tweets with the hashtag #GroPro were displayed on a big TV screen in the hall just outside of the conference rooms.  I took a short video of it that you can see below.  It even includes one of my tweets (I’m blushing)!  You can recreate the tweets and visual effects on your computer by going to http://visibletweets.com/.

Highlights from the Zappos Office Tour

Throughout my life, I’ve had opportunities to tour the headquarters of several large companies, but what I experienced today at Zappos was very unique. First, I have to thank Jody Padar and Jason Blumer, two awesome CPAs, for setting up the tour for me and 30-or-so other CPAs and accountants interested in learning about the Zappos culture. Zappos has established ten core values from which it develops its culture.  The third core value, create fun and a little wierdness, revealed itself immediately as we begain walking around the office.  The Zappos culture promotes individual creativity and self-expression, as evidenced by cubicles that were better decorated than any I had ever seen and a stairway where employees have written on the walls!   The picture to the right shows the “blogging bus” built around a set of cubicles which provides inspiration to the blogging team (and since I sometimes need inspiration, maybe I should try that)! At the end of the tour, Zappos gave us a “culture book” which contains, for the most part, the thoughts and feelings of Zappos’ employees.  The book provides evidence of the employees’ high morale and happiness they find in working for the company.  Some even wrote that they go to work smiling every day, and from what I observed in our tour today, I believe it.