Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Wednesday, February 25, 2009

Google Tweets

Earlier today, Google posted the following on Twitter
I'm 01100110 01100101 01100101 01101100 01101001 01101110 01100111 00100000 01101100 01110101 01100011 01101011 01111001 00001010
This looks suspiciously like ASCII, so I set out to render it in a more human readable form:
Bin       Hex ASCII
0110 0110 66 f
0110 0101 65 e
0110 0101 65 e
0110 1100 6C l
0110 1001 69 i
0110 1110 6E n
0110 0111 67 g
0010 0000 20 (space)
0110 1100 6C l
0111 0101 75 u
0110 0011 63 c
0110 1011 6B k
0111 1001 79 y
0000 1010 0A \n
I doubt I'm the first to post this, but there you have it :-)

Wednesday, October 15, 2008

Twitter Client

As a proof of concept for using the sippycode HTTP library which I wrote about in my last post, I decided to create a simple text console client for Twitter. Download the Twitter terminal application here.

Twitter's RESTful API is quite simple, and I wrote an open source library for Twitter based on the sippycode HTTP library in a few minutes. Here's an example of posting a new update (tweeting):
import sippycode.http.core as http_core
import sippycode.auth.core as auth_core

class TwitterClient(object):

def __init__(self, username, password):
self._credentials = auth_core.BasicAuth(username,
password)

def update(self, message):
request = http_core.HttpRequest(method='POST')
http_core.parse_uri(
'http://twitter.com/statuses/update.xml'
).modify_request(request)
request.add_form_inputs({'status': message})
self._credentials.modify_request(request)
client = http_core.HttpClient()
response = client.request(request)
return response
In the above, the client sends an authenticated POST to the updates URL. Using the TwitterClient in your code looks like this:
client = TwitterClient('my-username', 'my-password')
client.update('Try out this Twitter client: http://oji.me/wP')
To try out this Twitter console app, unpack the download and run sippy_twitter.py. With it, you can update your status on Twitter or read the updates from your friends. When reading, the client displays five updates at a time, since showing more at once would likely cause some to scroll off the top of the screen (assuming the terminal displays twenty-five lines).

This simple application was designed to be a proof of concept, but it's really grown on me. Cycling through all of my friend's updates doesn't require any scrolling, and it feels snappier than the web interface. It seems like others are enjoying this terminal client too.

There are quite a few ways that this client could be improved, so there's plenty of opportunity to pitch in if you are interested. I have received feature requests from friends who previewed this app, such as: support command line arguments which will allow the client to perform updates when being run from another program, show a running countdown from 140 characters as you are typing your update (could probably be done using ncurses), ability to follow users, and read updates from just one user. If you'd like to participate in any of these, let me know in the comments.

Fire up your terminal and give this client a try. Why not post an update to @jscud right now?

Monday, January 14, 2008

Twitter

If you've never tried Twitter, it might just be worth your while. I've been using it for a few months now and I'm quite pleased. As much as I try to make frequent blog updates, writing an entire entry sometimes feel like a large task. In contrast, twitter imposes a strict 140 character limit. This limit is both challenging and freeing in some ways: How much can you pack into a sentence or two? In addition to providing a place to share small updates, Twitter introduces a social aspect as well. By using @username notation, you can let everyone know your post was directed to a specific person so that they have a window into the conversation.

If you are familiar with Facebook, using Twitter is a bit like having a website made of just your profile status and your wall. These are my two favorite features of Facebook, so perhaps this is why I enjoy Twitter. The main difference is that you never post on someone else's wall, your posts show up on their wall if they choose to "follow" you (subscribe to your updates). I've never really used my phone to twitter (yes twitter is also a verb) or receive updates, but supporting posts from multiple platforms is a big selling point for some users.

My Twitter page is here and I also include a feed viewer gadget here on my blog to display my last few Twitter posts. If you have an account post it below!