Created
April 3, 2013 22:06
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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