\n END; if($site == 'argusleader') { echo <<\n END; } if($site == 'cnntech') { echo <<\n END; } if($site == 'cnnbiz') { echo <<\n END; } } function finish_things() { echo << END; return; } class RSSParser { var $insideitem = false; var $tag = ""; var $title = ""; var $description = ""; var $link = ""; var $i = "0"; var $art_num = "0"; function setnum($artnum) { $this->art_num = $artnum; } function startElement($parser, $tagName, $attrs) { if ($this->insideitem) { $this->tag = $tagName; } elseif ($tagName == "ITEM") { $this->insideitem = true; } } function endElement($parser, $tagName) { if ($tagName == "ITEM") { $this->i++; if($this->i >= "5") { return; } if(strlen($this->description) < '155') { $ender = ""; } else { $ender = "..."; } printf("

%s

\n", trim($this->link),htmlspecialchars(trim($this->title))); printf("

%s$ender

\n", substr(htmlspecialchars(trim($this->description)),0,155),trim($this->link)); $this->title = ""; $this->description = ""; $this->link = ""; $this->insideitem = false; /* $this->i++; */ /* if($this->i >= "4") { return; finish_things(); } */ } } function characterData($parser, $data) { if ($this->insideitem) { switch ($this->tag) { case "TITLE": $this->title .= $data; break; case "DESCRIPTION": $this->description .= $data; break; case "LINK": $this->link .= $data; break; } } } } function get_news($src) { /* $src = $_GET['src']; */ /* $sz = $_GET['sz']; */ if(($_GET['sz'] == 'sm') || (!$_GET['sz'])) { $a_num = "4"; } if($_GET['sz'] == 'lg') { $a_num = "10"; } if($src == 'argusleader') { /* $url = "http://www.argusleader.com/apps/pbcs.dll/section?category=rss03&mime=xml"; */ /* $url = "http://searchenginewatch.com/sew.xml"; fuck sew */ /* $url = "http://feeds.searchengineland.com/searchengineland?format=xml"; */ $url = "http://feeds.searchengineland.com/~d/styles/rss2full.xsl"; start_thing('argusleader'); } if($src == 'omahaworldherald') { $url = "http://www.omaha.com/rss_data/pg_46.xml"; start_thing('omahaworldherald'); } if($src == 'cnntech') { $url = "http://rss.cnn.com/rss/cnn_tech.rss"; start_thing('cnntech'); } if($src == 'cnnbiz') { $url = "http://rss.cnn.com/rss/money_topstories.rss"; start_thing('cnnbiz'); } if($src == 'digg') { $url = "http://www.digg.com/rss/containertechnology.xml"; start_thing('cnnbiz'); } $xml_parser = xml_parser_create(); $rss_parser = new RSSParser(); xml_set_object($xml_parser,&$rss_parser); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("$url","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) { xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } fclose($fp); xml_parser_free($xml_parser); unset($src); } function connect2db($serv,$user,$pass,$ttdb) { $a = mysql_connect($serv, $user, $pass) or die ("Can't connect to DB due to,".mysql_error()); mysql_select_db($ttdb, $a) or die ("Can't connect to the DB due to,".mysql_error()); } function get_blogs($num) { connect2db("slurpee.empirezero.net","cvmedia_blogger","1SDbd4K","cvmedia_blog"); $query = "SELECT * FROM `ENTRIES` ORDER BY `TIMESTAMP` DESC LIMIT $num;"; $send_query = mysql_query($query); while($query_info = mysql_fetch_assoc($send_query)) { $title = stripslashes($query_info['TITLE']); $s_title = $query_info['S_TITLE']; $content = stripslashes($query_info['CONTENT']); $author = stripslashes($query_info['AUTHOR']); $timestamp = date("F j, Y", $query_info['TIMESTAMP']); $m = date("m", $query_info['TIMESTAMP']); $y = date("Y", $query_info['TIMESTAMP']); $d = date("d", $query_info['TIMESTAMP']); echo <<{$title}
{$content}
END; /*
 
*/ } } ?> MVI | ClearVision Media - A Fort Collins Colorado Web Development and Search Engine Marketing Company specializing in Search Engine Optimization
Home
SELECT CLIENTS
EmpireZero Networks Sinus Specialty Clinics CCR Dakota Contruction The RiverWalk Catering and Banquet Facility
OptiVentures Dessert People