Douglas Purdy

Google Reader to Twitter (rdr2twt)

with 2 comments

I have had more than one of my followers on Twitter send me email or tell me in person that they love reading what I share from Google Reader, but they can’t stand going from Twitter to FriendFeed and then to the link.

You have to keep your audience happy, so I wrote rdr2twt. The below shows the key logic and I have attached the source below. Of course, I use MUrl for most of this (I found a bug – one of many I need to fix – in the Uri syntax – no support for ‘~’ – which I fixed in the grammar in this project).

static void Main(string[] args)
{
    ServicePointManager.Expect100Continue = false;

    var formatter = new Atom10FeedFormatter();

    formatter.ReadFrom(XmlReader.Create("your-shared-items-feed"));

    var feed = formatter.Feed;

    var lastUpdate = GetLastUpdate();

    var items = from item in feed.Items
                where Compare(item, lastUpdate)
                select item;

    foreach (SyndicationItem item in items)
    {
        Tweet(item);
    }

    if (items.Count() > 0)
    {
        SetLastUpdate(GetTimestamp(items.ElementAt(0)));
    }
}

Source: rdr2twt.zip
 

March 26th, 2009 at 7:10 pm

Posted in Microsoft, Oslo, Software Development

2 Responses to 'Google Reader to Twitter (rdr2twt)'

Subscribe to comments with RSS or TrackBack to 'Google Reader to Twitter (rdr2twt)'.

  1. I think you should be able to do the same with TwitterFeed.

    Subbu Allamaraju

    26 Mar 09 at 23:50

  2. [...] Prereading: Google Reader to Twitter (rdr2twt) [...]

Leave a Reply