Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pull GitHub activity feed into WordPress and output the items of interest.
$feed = fetch_feed('');
// some activity isn't interesting enough to output
$ignore_types = array(
$i = 0;
foreach ($feed->get_items() as $item) {
if ($i == 5) {
$content = $item->data['child']['']['content'][0]['data'];
$skip = false;
foreach ($ignore_types as $type) {
if (strpos($content, '<!-- '.$type.' -->') !== false) {
$skip = true;
if (!$skip) {
// we're trusting GitHub's content here
echo '<div class="activity-item">'.$content.'</div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.