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: 23710
- Hits: 129879
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 |
| Thursday Mar 4 |
23676 |
160358 |
| Friday Mar 5 |
23530 |
148887 |
| Saturday Mar 6 |
23249 |
165014 |
| Sunday Mar 7 |
23291 |
164067 |
| Monday Mar 8 |
23742 |
135478 |
| Tuesday Mar 9 |
23724 |
139467 |
| Wednesday Mar 10 |
23710 |
129879 |