i blog often
but i twitter often-er.
Last night i was having one of my “cant sleep, must code” fits and decided to whip up my own version of a twitter sidebar widget. Now, on the right of every page, you’ll see “what i’m thinking” followed by a short burst of thought.
Twitter, for those of you somehow unfamiliar, finds a happy medium between stream of conscious and blogging. In this particular case, i have 140 characters to answer the question, “what are you doing right now”. The really cool part is it’s updatable via SMS, AIM/GTalk/Jabber, or the REST interface provided in their API. So you get microblogging, on the run.
Anyway, my little mash together utilizes the twitter personal feed, and SimplePie for mega-simple feed parsing.
Code example after the break.
<?phprequire('simplepie.inc');$feed = new SimplePie();$feed->feed_url('http://twitter.com/statuses/user_timeline/8412.rss');$feed->cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');$feed->init();$feed->handle_content_type();if ($feed->data) {$max = $feed->get_item_quantity(1);for ($x = 0; $x < $max; $x++) {$item = $feed->get_item($x);?><p><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></p><?}}?>
[tags]twitter, simplepie, mashup[/tags]
Find out details or sign up below. Save $75 by using the code DANGER.


