Please submit bugs to Jean[dot]Gourd[at]usm[dot]edu * * * * Please feel free to use this code. I only ask that you leave my copyright notice * * within your source. Hey, it's not such a huge thing to ask, right? * ************************************************************************************* * This is free software; you can redistribute it and/or modify it under the terms * * of the GNU General Public License as published by the Free Software Foundation; * * either version 2 of the License, or (at your option) any later version. * * * * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * * PURPOSE. See the GNU General Public License for more details. * * * * To obtain a copy of the GNU General Public License, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *************************************************************************************/ $WOOT_RSS_URL = "http://www.woot.com/blog/rss.aspx"; $item = false; $current_tag = ""; $first_item = true; $title = ""; $description = ""; $link = ""; $pub_date = ""; $media_title = ""; $media_thumbnail = ""; get_rss(); function get_rss() { global $WOOT_RSS_URL; $xp = xml_parser_create(); xml_set_element_handler($xp, "start_element", "end_element"); xml_set_character_data_handler($xp, "char_element"); $fp = fopen($WOOT_RSS_URL, "r"); if (!$fp) echo "Cannot read RSS feed
\n"; else { while ($data = fread($fp, 4096)) xml_parse($xp, $data, feof($fp)); fclose($fp); } xml_parser_free($xp); } function start_element($xp, $tag_name, $attributes) { global $item, $current_tag, $first_item; if ($item && $first_item) $current_tag = $tag_name; else if ($tag_name == "ITEM" && $first_item); $item = true; } function end_element($xp, $tag_name) { global $item, $current_tag, $first_item; global $title, $description, $link, $pub_date, $media_title, $media_thumbnail; if ($tag_name == "ITEM" && $first_item) { echo htmlspecialchars(trim($pub_date)) . "