Tag Archives: Twitter

Adding TweetBacks to Thesis

Was trying to add the tweetback plugin to my thesis themed blog recently and found out that the tweets doesn’t appear automatically as comments if you just enable the plugin. Some searching around didn’t help much either. Here is a step by step account on what worked for me.

Download and Install TweetBacks Plugin
You can just search for the term “tweetback” on your WordPress plugin installer or go to Yoast

Activate and Configure TweetBacks
Activate the plugin and do the basic configuration available, including update frequency, list of exclusions, etc.

Edit comments.php
Go to Appearance > Editor in your admin area and edt comments.php.

Find the line of code below

And replace it with the below code

You’re all set! The tweets will now appear as trackbacks.

Call Twitter APIs from C# .Net

Twitter has an API implementation that is very simple to understand and use. Here is how it works, if you want to get the friends timeline of a user.

http://twitter.com/statuses/friends_timeline.rss

Here there are 3 keywords.
What are you working on? statuses
What do you need from the above object? friends_timeline
In what format do you need it? RSS

Formats supported are: xml, json, rss, atom
Methods supported: See Twitter API
There are many objects supported, but the above format applies for only a few like Statuses, User, Direct Messages. The rest are also similar.

Now, let us look at a GET to bring in Friend Status.

First off, we would need the URL above

The public method GetFriendsStatus calls a generic method InvokeAPI to (surprise!) invoke the API. This function in turn relies on GetUrl to build the URL for this request. AskTwitter is a helper method that does a GET request and returns the result.

As you can see, AskTwitter takes in 2 parameters. First one is the URL we built earlier. The second parameter is user credential, for requests that require credentials. This can be built easily as below.

Hope that helped get you started. Am working on a complete set of wrappers that will make using these APIs much more easier. Please leave a comment and let me know if you would be interested in any specific features.