public function setAccountId($id)
 {
     $this->RSS_Account_ID = $id;
     //RSSソースリセット
     $this->Source = null;
     //$FeedObj = new Feed();
     $RSS_AccountObj = new RSS_Account();
     $this->RSS_AccountInfo = $RSS_AccountObj->getAccountById($id);
     //RSSフィード取得
     // if($this->RSS_AccountInfo->feed_type === 'RSS2'){
     //     $this->Source = $FeedObj->loadRss($this->RSS_AccountInfo->rssfeed_url);
     // }elseif($this->RSS_AccountInfo->feed_type === 'Atom'){
     //     $this->Source = $FeedObj->loadAtom($this->RSS_AccountInfo->rssfeed_url);
     // }elseif($this->RSS_AccountInfo->feed_type === 'RSS1'){
     //     //$this->Source = simplexml_load_string(file_get_contents($this->RSS_AccountInfo->rssfeed_url));
     //     $this->Source = simplexml_load_file($this->RSS_AccountInfo->rssfeed_url);
     // }
     // else{
     //     $msg = 'RSS_TYPEの設定が不正です';
     //     throw new Exception($msg);
     // }
     $this->Source = simplexml_load_file($this->RSS_AccountInfo->rssfeed_url);
     if ($this->Source === false) {
         $msg = 'RSSフィードの取得に失敗しました';
         throw new Exception($msg);
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     //動作有効になっているアカウント取得
     $RSS_AccountObj = new RSS_Account();
     $this->RSS_Accounts = $RSS_AccountObj->getValidAccount();
     $this->LogicObj = new Cron_Rss_GetSource_Logic();
     $this->logFile = 'rss_log_' . date("Y_m_d") . ".log";
 }
Exemplo n.º 3
0
require_once "../conf.php";
require_once _TWITTER_CLASS_PATH . "Cron_Rss_GetSource_Logic.php";
require_once _TWITTER_CLASS_PATH . "RSS_Data_Container.php";
require_once _TWITTER_CLASS_PATH . "RSS_Account.php";
require_once _TWITTER_CLASS_PATH . "DB_Base.php";
if (!isset($_REQUEST['id'])) {
    exit;
}
if (is_numeric($_REQUEST['id'])) {
    $RSS_AccountID = $_REQUEST['id'];
} else {
    echo 'idが不正';
    exit;
}
$RSS_AccountObj = new RSS_Account();
$RSS_AccountInfo = $RSS_AccountObj->getAccountById($RSS_AccountID);
$ligicObj = new Cron_Rss_GetSource_Logic();
$ligicObj->setAccountId($RSS_AccountID);
//デバッグモード
$ligicObj->setDebug();
$analysis_method = 'analysis_' . $RSS_AccountInfo->name;
if (!method_exists($ligicObj, $analysis_method)) {
    echo $analysis_method . " RSS解析メソッドが定義されていません";
}
?>
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RSSテスト</title>
</head>