Here is the php:
PHP Code:
<?php $type=$_REQUEST["Type"]; $term=$_REQUEST["Term"]; $count=$_REQUEST["Count"]; $menu=$_REQUEST["Menu"]; $ch = curl_init(); $timeout = 0; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, "http://api.bing.net/json.aspx?AppId=F8DA6024CF16F034D58524456E231A65BC9FE6E6&Market=en-US&Query=".$term."&Sources=".$type."&".$type.".Count=".$count."&JsonType=raw"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $search = curl_exec($ch); curl_close($ch); $Response = json_decode($search,true); if ($term == "")$term = "Top News Stories"; $term = str_replace("site:","",$term); $term = explode(".", $term); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <link href = "style.css" rel = "stylesheet" type = "text/css"> <script type = 'text/javascript' src = '../scriptaculous/lib/prototype.js'></script> <script type = 'text/javascript' src = '../scriptaculous/src/scriptaculous.js'></script> </head> <body> <div id = "container"> <div id = "text1"> <?php foreach($Response['SearchResponse'][$type]['Results'] as $item) { echo(" <div class = 'Source' style='color:green'><b>$term[0]</b></div> <div class = 'Title' onmouseover = \"clearInterval(Scroll)\" onmouseout = \"clearInterval(Scroll); Scroll = setInterval ('scroll()', 50)\"><b><a href='$item[Url]' target='_blank' style='color:yellow'></b>$item[Title]</b></a></div> <div class = 'Description' style='color:#cccccc'>$item[Snippet]</div> <br> "); } ?> </div> <div id = "text2"> <?php foreach($Response['SearchResponse'][$type]['Results'] as $item) { echo(" <div class = 'Source' style='color:green><b>$term[0]</b></div> <div class='Title' onmouseover = \"clearInterval(Scroll)\" onmouseout = \"clearInterval(Scroll); Scroll = setInterval ('scroll()', 50)\"><b><a href = '$item[Url]' target='_blank' style='color:yellow'></b>$item[Title]</b></a></div> <div class='Description' style='color:#cccccc'>$item[Snippet]</div> <br> "); } ?> </div> </div> <?php if(file_exists("$menu")) { echo(" <div id = 'menu'>".file_get_contents($menu)."</div> "); } ?> <script type = "text/javascript"> resize(); window.onresize = resize; var Scroll = setInterval ("scroll()", 50); function scroll() { if (parseInt($('text1').style.top) <= 0) { $('text2').style.top = parseInt($('text1').style.top) + $('text1').getHeight() + 'px'; } if (parseInt($('text2').style.top) <= 0) { $('text1').style.top = parseInt($('text2').style.top) + $('text2').getHeight() + 'px'; } $('text1').style.top = parseInt($('text1').style.top) - 1 +'px'; $('text2').style.top = parseInt($('text2').style.top) - 1 +'px'; }
function resize() { $("container").style.height = document.viewport.getHeight() - 50 + 'px'; $("container").style.width = document.viewport.getWidth() + 'px'; $('text1').style.top = 0 + 'px'; $('text2').style.top = $('text1').getHeight() + 'px'; $('menu').style.top = $("container").style.height } </script>
Here is the css:
Code:
@CHARSET "ISO-8859-1";
*
{
padding:0;
margin:0;
}
body
{
background-color: transparent;
color: #ffffff;
overflow: hidden;
}
#container
{
background-color: transparent;
overflow: hidden;
}
#menu .ul
{
display: inline-block;
height: 30px;
text-align: center;
background-color: transparent;
}
#text1
{
position: absolute;
text-align: left;
background-color: transparent;
}
#text2
{
position: absolute;
text-align: left;
background-color: transparent;
}
Normally the page loads in an iframe, but this url will display it without iframe: http://ticktach.biz/news/index.php?T...&Menu=menu.txt
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
|