分类:
2008-05-30 09:02:28
以下为引用的内容: <link href="css/layout.css" rel="stylesheet" type="text/css" /> <script src="js/request.js"></script> |
以下为引用的内容: <body onload="javascript:makeRequest('request.php?request=' + document.feedForm.feed.value + '"password=mypassword');"> <form name="feedForm" method="post" action="javascript:makeRequest('request.php?request=' + document.feedForm.feed.value + '"password=mypassword');"> Enter a feed: <input type="text" name="feed" id="feed" size="20"> <input type="submit" name="submit" value="Add Feed"> </form> <div id="logo"></div> <hr/> <div id="copy"></div> <div id="details"></div> </body> |
以下为引用的内容: //如果不存在目录就创建一个 $dir = "rss"; if(!is_dir($dir)) { mkdir($dir, 0666); } |
以下为引用的内容: //创建唯一的命名 $file=md5($rss_url); $path="$dir/$file.xml"; |
以下为引用的内容: //复制馈送到本地服务器 copy($rss_url,"$path"); return $path; Following is the small, yet powerful RSS class in its entirety: <?php class RSS { function get($rss_url) { if($rss_url != "") { //如果不存在目录就创建一个 $dir = "rss"; if(!is_dir($dir)) { mkdir($dir, 0666); } // 创建一个唯一的名字 $file = md5($rss_url); $path = "$dir/$file.xml"; //复制馈送到本地服务器 copy($rss_url, "$path"); return $path; } } } ?> |
以下为引用的内容: <? if($password == "mypassword") { require_once('classes/RSS.class.php'); $rss = new RSS(); echo $rss->get($request); } else { echo "You are an unauthorized user"; } ?> |
以下为引用的内容: function sendFeed(url){ post.onreadystatechange = sendRequest; post.open("POST", url, true); post.send(url); } |
以下为引用的内容: function sendRequest(){ if(checkReadyState(post)){ request = createRequestObject(); request.onreadystatechange = onResponse; request.open("GET", post.responseText, true); request.send(null); } } |
以下为引用的内容: var _logo = ""; var _title = response.getElementsByTagName('title')[0].firstChild.data; var _link = response.getElementsByTagName('link')[0].firstChild.data;; _logo += "<a href='" + _link + "' target='_blank'>" + _title + "</a><br/>"; if(checkForTag(response.getElementsByTagName('image')[0])) { var _url = response.getElementsByTagName('url')[0].firstChild.data; _logo += "<img src='" + _url + "' border='0'><br/>" } document.getElementById('logo').innerHTML = _logo; |
以下为引用的内容: if(checkForTag(response.getElementsByTagName('image')[0]) "" i>0){ var _title=response.getElementsByTagName('title')[i+1].firstChild.data; var _link=response.getElementsByTagName('link')[i+1].firstChild.data; } else{ var _title =response.getElementsByTagName('title')[i].firstChild.data; var _link = response.getElementsByTagName('link')[i].firstChild.data; } |
以下为引用的内容: function checkForTag(tag){ if(tag != undefined) { return true; } else{ return false; } } |
以下为引用的内容: if(i>1){ var previousPubDate = response.getElementsByTagName('pubDate')[i-1].firstChild.data; } if(pubDate != previousPubDate || previousPubDate == undefined){ _copy += "<div id='detail'>" + pubDate + "</div><hr align='left' width='90%'/>"; } _copy += "<a href=\"javascript:showDetails('" + i + "');\">" + _title + "</a><br/><br/>"; document.getElementById('copy').innerHTML += _copy; |
以下为引用的内容: function showDetails(index){ document.getElementById('details').innerHTML = response.getElementsByTagName('description')[index].firstChild.data; } |