(.*?)<\/link>/",$xml,$matches); $utube_videos = array(); foreach($matches[1] as $match){ $utube_videos[] = str_replace("http://youtube.com/?v=","",$match); } $randomVid = $utube_videos[array_rand($utube_videos)]; if($randomVid){ $objectHTML = " "; } else { $objectHTML = "Error; Video Not Available"; } return $objectHTML; } function gBlog($count=20){ global $keyword; $url = "http://blogsearch.google.com/blogsearch_feeds?hl=en&output=rss&q=" . urlencode($keyword) . "&ie=utf-8&num=$count"; $xml = get($url); preg_match_all("@(.+?)@",$xml,$matches); foreach($matches[1] as $match){ $toprint .= $match . "

"; } return $toprint; } function msn($count=5){ global $keyword; $url = "http://search.msn.com/results.aspx?q=" .urlencode($keyword)."&format=rss&FORM=RSNR"; $xml = @get($url); preg_match_all("/(.*?)<\/title><link>(.*?)<\/link><description>(.*?)<\/description>/",$xml,$matches); $toprint = "<ul>"; for($i=0;$i<$count;$i++){ $toprint .= "<li><a href=\"" . $matches[2][$i] . "\" rel=\"external nofollow\">" . html_entity_decode($matches[2][$i]) . "</a></li>"; } $toprint .= "</ul>"; return $toprint; } function goarticles($paragraphsCount = 4){ global $keyword; $url = "http://www.goarticles.com/cgi-bin/rss-search.cgi?term=" . urlencode($keyword) . "&&l=20&s=1&c=none&D1=subject"; $xml = @get($url); preg_match_all("/<item>\s+<title>(.*?)<\/title>\s+<description>(.*?)<\/description>/",$xml,$matches); $paragraphs = array(); for($i=0;$i<count($matches[1]);$i++){ $paragraphs[] = "<strong>" . str_replace("...",".",$matches[1][$i]) . "</strong>. " . str_replace("...",".",$matches[2][$i]); } for($i=0;$i<$paragraphsCount;$i++){ $content .= "<p>" . $paragraphs[array_rand($paragraphs)] . "</p>"; } return $content; } function digg($paragraphsCount = 5){ global $keyword; $url = "http://digg.com/rss_search?search=" . urlencode($keyword) . "&area=all&type=both§ion=all"; $xml = @get($url); preg_match_all("#<title>(.*?)\s+.*?\s+(.*?)#",$xml,$matches); $paragraphs = array(); for($i=0;$i. " . str_replace("...",".",$matches[2][$i]); } for($i=0;$i<$paragraphsCount;$i++){ $content .= "

" . $paragraphs[array_rand($paragraphs)] . "

"; } return $content; } function yahoo_serp($paragraphsCount = 4){ global $keyword; $url = "http://search.yahooapis.com/WebSearchService/V1/webSearch?results=30&query=" . urlencode($keyword). "&appid=" . rand(1,1000000); $xml = @get($url); preg_match_all("#(.*?)(.*?)#i",$xml,$matches); for($i=0;$i. " . str_replace("...",".",$matches[2][$i]); } for($i=0;$i<$paragraphsCount;$i++){ $content .= "

" . $paragraphs[array_rand($paragraphs)] . "

"; } return $content; } ?>