Publishing shared google reader items to twitter.

Seems Feedburner by google which I’ve been using up until now is unreliable with posting to twitter, so this is a half post on what I’ve done to try getting it working, and half a post trying to test if it works with my wordpress at least 😛

Because Google reader’s rss feed of shared items is formatted a little strangely I made a short php script to parse it into a nicer format. OK, mainly getting rid of the annoying ‘Shared by <username> ‘ bit.

&lt;?php

$username = "Psykar";

$url = "http://www.google.com/reader/public/atom/user/10440293858886564202/state/com.google/broadcast";
$page = file_get_contents($url);

echo preg_replace('/Shared +by +'.$username.'/',null,$page);

?&gt;

To find your shared items url, just open reader, get the url which gets replaced, and remove the html entities %2F either side of the ID
eg for mine:

http://www.google.com/reader/view/#stream/user%2F10440293858886564202%2Fstate%2Fcom.google%2Freading-list

is 10440293858886564202

Plug this ID into the URL above

http://www.google.com/reader/public/atom/user/&lt;userid&gt;/state/com.google/broadcast

I then used feedburner to import this php script (hosted on my server) and activated the ‘socialize’ feature, which should be publishing all my shared items to twitter now, in a nice format.

One Response to “Publishing shared google reader items to twitter.”

  1. […] Psykar « Publishing shared google reader items to twitter. […]

Leave a Reply

You\'re not a robot are you? *