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: 24277
- Hits: 31488
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 |
| Saturday Jun 27 |
24163 |
29376 |
| Sunday Jun 28 |
24234 |
30023 |
| Monday Jun 29 |
24556 |
33700 |
| Tuesday Jun 30 |
24646 |
33813 |
| Wednesday Jul 1 |
24590 |
32614 |
| Thursday Jul 2 |
24511 |
32250 |
| Friday Jul 3 |
24277 |
31488 |