增加对空间支持的判断,获取feed方法更强大
This commit is contained in:
31
lastRSS.php
31
lastRSS.php
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Rss订阅
|
||||
Version: 1.3.2
|
||||
Version: 1.3.3
|
||||
Plugin URL: http://xiaosong.org/tech/the-official-releas-of-rss-subscribe-plugin
|
||||
Description: 订阅朋友的博客feed,显示在自己博客~
|
||||
Author: 小松
|
||||
@@ -13,7 +13,7 @@ require_once(EMLOG_ROOT.'/content/plugins/lastRSS/lastRSS_config.php');
|
||||
require_once(EMLOG_ROOT.'/content/plugins/lastRSS/lastRSS_class.php');
|
||||
$rssparser = new lastRSS;
|
||||
$rssparser->cache_dir = EMLOG_ROOT.'/content/cache/';
|
||||
$rssparser->cache_time = $lastRSS_cache_time;
|
||||
$rssparser->cache_time = $lastRSS_cache_time;
|
||||
$rssparser->items_limit = $lastRSS_item_num > 3 ? 3 : $lastRSS_item_num;
|
||||
$rssparser->CDATA = 'content';
|
||||
$rssparser->cp = 'UTF-8';
|
||||
@@ -93,25 +93,26 @@ function updateFeed($id, $url, $title){
|
||||
}
|
||||
function getTitle($rss_url){
|
||||
global $rssparser;
|
||||
$rss = $rssparser->get($rss_url);
|
||||
$rss = $rssparser->Get($rss_url);
|
||||
return $rss['title'];
|
||||
}
|
||||
function updateLogs(){
|
||||
global $rssparser, $DB, $lastRSS_is_urlshort, $lastRSS_is_blank;
|
||||
$feeds = getRssFeeds();
|
||||
while ($item = $DB->fetch_array($feeds)) {
|
||||
$rss = $rssparser->get($item['url']);
|
||||
if(!empty($rss['items']))
|
||||
foreach ($rss['items'] as $key => $data) {
|
||||
$rssid = $item['id'];
|
||||
$hash = md5($data['title']);
|
||||
$checklog = isLogExists($rssid, $hash);
|
||||
if ($checklog == 0) {
|
||||
if (trim($data['title']) != '') {
|
||||
$link = $lastRSS_is_urlshort ? urlShort($data['link']) : $data['link'];
|
||||
$target = $lastRSS_is_blank ? ' target="_blank"' : '';
|
||||
$log = '<a href="'.$link.'"'.$target.'>'.strip_tags($data['title']).'</a>';
|
||||
insertLog($rssid, $log ,$hash);
|
||||
$rss = $rssparser->Get($item['url']);
|
||||
if(!empty($rss['items'])) {
|
||||
foreach ($rss['items'] as $key => $data) {
|
||||
$rssid = $item['id'];
|
||||
$hash = md5($data['title']);
|
||||
$checklog = isLogExists($rssid, $hash);
|
||||
if ($checklog == 0) {
|
||||
if (trim($data['title']) != '') {
|
||||
$link = $lastRSS_is_urlshort ? urlShort($data['link']) : $data['link'];
|
||||
$target = $lastRSS_is_blank ? ' target="_blank"' : '';
|
||||
$log = '<a href="'.$link.'"'.$target.'>'.strip_tags($data['title']).'</a>';
|
||||
insertLog($rssid, $log ,$hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user