Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mondalaci/5305877 to your computer and use it in GitHub Desktop.
Save mondalaci/5305877 to your computer and use it in GitHub Desktop.
Proxy my Google Reader feed and add a link element to it so that the WordPress RSS widget can display a relevant header.
<?php
$shared_items_feed_url = 'http://www.google.com/reader/public/atom/user/04674577121720532529/state/com.google/broadcast';
$shared_items_page_url = 'http://www.google.com/reader/shared/mondalaci';
$source_atom_feed = file_get_contents($shared_items_feed_url);
$insert_pos = strpos($source_atom_feed, '<generator ');
$link_element = "<link href=\"$shared_items_page_url\" />";
$linked_atom_feed = substr($source_atom_feed, 0, $insert_pos) . $link_element . substr($source_atom_feed, $insert_pos);
print $linked_atom_feed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment