Example: Get Feed Data
Code Sample for Yesterday's Stats
<?php
$fb =& new feedburner('burnthisrss2');
$info = $fb->getFeedData();
if ($fb->isError()) {
echo $fb->getErrorMsg();
} else {
$entries = $info['entries'];
echo '<h2>Example Output</h2>';
echo "<h3>Yesterday's Stats</h3>";
echo '<ul>
<li>Circulation: ' . $entries['circulation'] . '</li>
<li>Hits: ' . $entries['hits'] . '</li>
</ul>';
}
?>
Example Output
Yesterday's Stats
- Circulation: 22143
- Hits: 19916
Code Sample for Past Weeks Stats
<?php
$fb =& new feedburner('burnthisrss2');
$date_str = date('Y-m-d', strtotime('-7 days', time())) . ',' . date('Y-m-d', time());
$info = $fb->getFeedData(array('dates'=>$date_str));
if ($fb->isError()) {
echo $fb->getErrorMsg();
} else {
$entries = $info['entries'];
if (count($entries) > 0) {
echo '<h2>Example Output</h2>';
echo '<table cellspacing="0" style="width:300px;">
<caption>Feedburner Stats for Last Seven Days</caption>
<thead>
<th>Day</th>
<th>Circulation</th>
<th>Hits</th>
</thead>
<tbody>';
foreach($entries as $entry) {
echo '<tr>
<td>' . date('l M j', strtotime($entry['date'])) . '</td>
<td>' . $entry['circulation'] . '</td>
<td>' . $entry['hits'] . '</td>
</tr>';
}
echo '</tbody>
</table>';
}
}
?>
Example Output
Stats for Last Week
| Day |
Circulation |
Hits |
| Friday Nov 14 |
23192 |
40774 |
| Saturday Nov 15 |
20155 |
38975 |
| Sunday Nov 16 |
22813 |
40871 |
| Monday Nov 17 |
23254 |
42397 |
| Tuesday Nov 18 |
23260 |
40041 |
| Wednesday Nov 19 |
22143 |
19916 |