14 comments

[ 5.1 ms ] story [ 44.7 ms ] thread
Reminds me of Tweet MVC, a PHP model-view-controller framework a former co-worker created for fun. Each component (like “model”) is 140 or fewer characters. It definitely doesn’t follow many best practices ;)

https://github.com/tweetmvc/tweetmvc-core

(But hey, `import twitter as t`? Abstract things enough and any super-simple program can be 140 characters)

"import twitter"?
From the article:

"And yes, I’m aware that using a pre-existing library to interface with the Twitter API might be considered “cheating”, but it would be downright impossible to fit the script into the size constraints without it. The API endpoint URLs alone would probably be long enough to push the script over the limit."

Edit: Before this turns into a gauntlet[1], I'm simply quoting the article so that people don't think the author is oblivious to this fact.

[1] http://wordnetweb.princeton.edu/perl/webwn?o2=&o0=1&...

And that is exactly why this doesn't make sense at all... it's just not possible to code it with these few lines.
I don't understand this rationale: Posts are limited to 140 characters on a certain website ∴ Everything should fit in 140 chars
Just because he's aware of it doesn't mean it's any less silly. Want to see me write a fully functional optimizing c compiler in a tweet? "/usr/bin/gcc" :/
Might as well do,

    from twitter import updae_status as u
    u('Yay!')
Brilliant! I tweeted it as soon as I read it.
I'm fairly sure at least the posting tweets part of this won't work anymore since basic auth was turned off a few months ago. It looks like this was posted not too long before basic auth was turned off though.
So, who will write the first OAuth Twitter client in 140 chars?
well, you wouldn't really, or it would be the same code as presented here without the login information. oauth credentials are pulled from constants, a security file, or the environment, so it is just a different paradigm, but the code is actually just a little simpler, it is devoid of most login logic other than passing the keys.
My best attempt (jQuery):

    $.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=ElbertF&callback=?',function(json){alert(json[0].text)})
The long API URL alone makes it pretty much impossible to make something useful, this "client" simply gets the latest tweet and can't post updates. Not much of a client, I know.