コード例 #1
0
ファイル: example.php プロジェクト: vasea101/feed-parser
<?php

/*
 *
 *		Simple Example of how to use Feed Parser Class
 *		by Marc Qualie
 *
 */
include 'class.feedparser.php';
$feed = new FeedParser();
// Two different ways of getting blogger feeds, both end up in at the same url
$blog1 = $feed->blogger('blog.marcqualie.com', 1);
$blog2 = $feed->blogger('marcqualie', 1);
// Twitter via Username
$tweets = $feed->twitter('marcqualie', 1);
// Output
header('Content-type: text/plain');
echo "Bandwidth: {$feed->bandwidth}\n";
echo "Requests: {$feed->requests}\n";
echo "\n";
// Dump
$output = 'blog1  = ' . print_r($blog1, 1) . "\n";
$output .= 'blog2  = ' . print_r($blog2, 1) . "\n";
$output .= 'tweets = ' . print_r($tweets, 1) . "\n";
$fh = fopen('example.log', 'w');
fwrite($fh, $output);
fclose($fh);
コード例 #2
0
ファイル: blogger.php プロジェクト: vasea101/feed-parser
<?php

/*
 *	
 *		Basic Blogger Data Dump
 *		This file will download your blogger feed and save to log file
 *
 */
include 'class.feedparser.php';
$feed = new FeedParser();
$limit = 1;
$user = '******';
$data = $feed->blogger($user, $limit);
$fh = fopen('blogger.log', 'w');
fwrite($fh, print_r($data, 1));
fclose($fh);
echo "Downloaded " . count($data['posts']) . " posts\n";
echo "Bandwidth Usage: {$feed->bandwidth}\n";
echo "Requests: {$feed->requests}\n";
echo "\n";