[Twitter-compatible API: public_timeline.rss mostly working zach@copley.name**20080716072124] { hunk ./actions/twitapistatuses.php 50 + hunk ./actions/twitapistatuses.php 56 - // of notices by users who have custom avatars + // of notices by users who have custom avatars -- Zach hunk ./actions/twitapistatuses.php 73 - common_server_error("API method under construction.", $code=501); + + //header('Content-Type: application/xml; charset=utf-8'); + + header("Content-Type: application/rss+xml; charset=utf-8"); + + $this->init_twitter_rss(); + + common_element_start('channel'); + common_element('title', NULL, 'Identi.ca public timeline'); + common_element('link', NULL, 'http://www.identi.ca'); + common_element('description', NULL, 'Identi.ca updates from everyone!'); + common_element('language', NULL, 'en-us'); + common_element('ttl', NULL, '40'); // 40 what? + + if ($cnt > 0) { + for ($i = 0; $i < 20; $i++) { + if ($notice->fetch()) { + $twitter_status = $this->twitter_status_array($notice); + $this->show_twitter_rss_item($twitter_status); + } else { + // shouldn't happen! + break; + } + } + } + common_element_end('channel'); + + $this->end_twitter_rss(); + hunk ./lib/twitterapi.php 156 + + function init_twitter_rss() { + + common_start_xml(); + common_element_start('rss', array('version' => '2.0')); + } + + function end_twitter_rss() { + + common_element_end('rss'); + common_end_xml(); + + } + + function get_twitter_channel() { + + } + +/* + + + CapitalD: @baxterd Have you read The Conquest of Cool? It looks interesting to me... + CapitalD: @baxterd Have you read The Conquest of Cool? It looks interesting to me... + Mon, 14 Jul 2008 23:54:13 +0000 + http://twitter.com/CapitalD/statuses/858499551 + http://twitter.com/CapitalD/statuses/858499551 + + +*/ + + function show_twitter_rss_item($twitter_status) { + common_element_start('item'); + common_element('title', NULL, "{$twitter_status[user][screen_name]}: $twitter_status[text]"); + common_element('description', NULL, "{$twitter_status[user][screen_name]}: $twitter_status[text]"); + common_element('pubDate', NULL, "$twitter_status[created_at]"); + common_element('guid', NULL, "$twitter_status[id]"); + common_element('link', NULL, "$twitter_status[id]"); + common_element_end('item'); + } + }