Esempio n. 1
0
			//<![CDATA[
				var icon = parent.document.getElementById("iconFeedStatus<?php 
    echo $feed['id'];
    ?>
");
				if(icon) {
					try{
						parent.Reader.startScroll("feedBox", getOffsetTop(icon) - getOffsetTop(parent.document.getElementById("feedBox")) - 50);
					} catch(e) {alert(e.message);}
					icon.src = servicePath + "/resources/style/default/image/reader/iconUpdateIng.gif";
				}
			//]]>
		</script>
<?php 
    $count++;
    $result = updateFeed($feed);
    ?>
		<script type="text/javascript">
			//<![CDATA[
				/* update complete : [<?php 
    echo $result;
    ?>
] <?php 
    echo $feed['xmlurl'];
    ?>
 */
				if(icon) {
					switch(<?php 
    echo $result;
    ?>
) {
            print $url . " - updated.\n";
        } else {
            print $url . " - not updated.\n";
        }
    }
}
// Process queue argument
if ($doQueue) {
    $queueURL = $sqs->create_queue(FEED_QUEUE)->body->CreateQueueResult->QueueUrl;
    while (true) {
        $message = pullMessage($sqs, $queueURL);
        if ($message != null) {
            $messageDetail = $message['MessageDetail'];
            $receiptHandle = (string) $message['ReceiptHandle'];
            $url = $messageDetail['FeedURL'];
            if (updateFeed($sdb, $url)) {
                print $url . " - updated.\n";
            } else {
                print $url . " - not updated.\n";
            }
            // Delete the message
            $sqs->delete_message($queueURL, $receiptHandle);
        }
    }
}
/*
 * updateFeed -
 *
 *  Fetch the latest version of the RSS from the given URL.
 *  Return true on success, false on error.
 *
Esempio n. 3
0
function updateRandomFeed()
{
    global $database;
    $updatecycle = POD::queryCell("SELECT updatecycle FROM {$database['prefix']}FeedSettings LIMIT 1");
    if ($updatecycle != 0) {
        if ($feed = POD::queryRow("SELECT * FROM {$database['prefix']}Feeds WHERE modified < " . (gmmktime() - $updatecycle * 60) . " ORDER BY RAND() LIMIT 1")) {
            Setting::setServiceSetting('lastFeedUpdate', gmmktime(), true);
            return array(updateFeed($feed), $feed['xmlurl']);
        }
    }
    return array(1, 'No feeds to update');
}
Esempio n. 4
0
 /**
  * Refresh the listings that were brought in from the TopLine Service
  */
 public function refreshFeed()
 {
     if (function_exists('updateFeed')) {
         updateFeed();
     }
 }