rendered paste body<?php
function get($url){
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
$html = curl_exec($ch);
curl_close($ch);
return $html;
}
function youtube(){
global $keyword;
$url = "http://www.youtube.com/rss/tag/" . urlencode($keyword) . ".rss";
$xml = @get($url);
preg_match_all("/<link>(.*?)<\/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 = "<object width=\"425\" height=\"350\">
<param name=\"movie\" value=\"http://www.youtube.com/v/$randomVid\">
</param><param name=\"wmode\" value=\"transparent\"></param>
<embed src=\"http://www.youtube.com/v/$randomVid\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\">
</embed>
</object>";
} else { $objectHTML = "<font color=\"red\">Error; Video Not Available</font>"; }
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("@<description>(.+?)</description>@",$xml,$matches);
foreach($matches[1] as $match){
$toprint .= $match . "<p>";
}
return $xml;
}
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("/<item><title>(.*?)<\/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>(.*?)</title>\s+.*?\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 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("#<title>(.*?)</title><summary>(.*?)</summary>#i",$xml,$matches);
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;
}
?>