Using Coconuts - a Pythonic Blog

Username:

Password:


Don't have an account? Get one!

Two Tweetings To Twitter

http://blog.opensourcenerd.com/upload/twitter-bird-small

I know I sound stupid mentioning Twitter barely now, but let's try to put that aside. I know about Twitter, and I have a Twitter account, I really haven't seen a use for it before. I have considered and taken up (for 1 or 2 tweets) the habit of tweeting every little aspect of my life. However, that seemed like I was intruding on my own privacy, akin to how I don't put a neon sign outside my window that reads "24/7 Filip watch". (I know some of you want to watch me while I sleep, but I'm sorry, my dorm is on the 4th floor and that's impossible.)

http://blog.opensourcenerd.com/upload/free-candy-van

I have plenty of Swedish Fish in my room, thank you very much.

However, more recently I've been reconsidering my decision to not use Twitter. No, I don't think my mundane life should be more public, but I do think that Twitter would facilitate sharing of cool stuff with people even more than my blog does. See, there's so many things I see that people might like that I can't post about all of them here (and keep up the quality of the writing, bad as it may be). Besides of them, many speak for themselves, and really don't deserve more than a plain one-liner and a link.

Yeah, I know, I'm being vague. Here's some examples of tweets that you'd find if I used my Twitter more often:

I'm pretty sure my Facebook friends would be happy if I posted all this on Twitter instead of spamming their news, too. So, what do y'all think?

(of note, a "poll" blog feature is also on its way :) )


Now, on the implementation of this, if I were to use it. Since Twitter messages are small, I could just put a widget on the side of the blog. However, I will not use Twitter's Flash "widget" thing. This is an open source blog, and Flash is closed source. Not that I boycott it, but I'm trying to avoid it especially in what I write.

Then what? If you look in the nice list of cool stuff I posted above, you'll see that I have a link to python-twitter. Here's how easy it is to install:

fsufitch@ubuntu:~$ sudo easy_install python-twitter

And here's how easy it is to use:

>>> import twitter
>>> api = twitter.Api()
>>> api.getUser('fsufitch').status.text
"Maybe I should use Twitter more, but for posting cool stuff!"

python-twitter is a wrapper around the API that Twitter itself provides to developers in order to make using it more "Pythonic". I could use this to make a page such as http://blog.opensourcenerd.com/twitstat (doesn't actually work currently) to display some simple HTML for rendering it, or nothing if the blog server isn't configured with someone's Twitter. My blog page could then fetch the Twitter status using AJAX.

The reason I don't want to just have it embedded in the page by default is that getting the status itself is a HTTP request, which has its own builtin delay time. If I were to make my server fetch the status upon page load, it would be slower in returning the page. This way, it can return the page with AJAX on it, then your (the viewer's) computer can do the waiting for the status, with a request to my server that's exclusively for the Twitter status.

It is a general piece of web development wisdom to dump whatever work or idling onto the user's computer instead of keeping it happening on the server, if possible. Chances are your computer is much more powerful than my server, and if it's something that's not vital to be present on the page upon load, and it can be rendered in Javascript, then let it be so.

By the way, yes, this also means that you meanies using NoScript or the likes will not be able to see the Twitter status if/when I implement it. Hmph.

I would first like to argue that by posting on twitter, you are hardly giving up any privacy--there's really not that much detail that you can give in 140 characters. But more to the point, I really don't think that posting a bunch of links is beneficial--especially if they aren't titled. For one, twitter shortens urls automatically, so they would all by bit.ly links. And by not having any type of description other than "this is cool," no one will want to click on it. It might be more acceptable if you wrote something like "Python-twitter seems really cool" and then put the link, but you didn't really do that in any of the examples you gave.

on 2009-10-18 06:06:45
New Comment
You're not logged in! Log in to be awesome!
Format: BBCode ReStructured Text

Author (max. 20 characters):