views:

544

answers:

1

I want to build a widget for WordPress that simultaneously displays my latest Google Reader items on the front page and allows for management from behind the WordPress dashboard. I can already add my "shared" items using code I've found in various Google searches, but that's not exactly what I'm looking for.

I like the functionality of the Google Reader widget in iGoogle, and I want to replicate that on the WordPress dashboard and build a read-only version for the WordPress front-end. Where do I start in the API (public or 'unofficial') to get this built?

-- Update --

I've found some limited documentation regarding authentication protocols, but I've been unable to implement anything. I can parse a URL to authenticate and get an SSID that works when directly placed in a browser, but both GET and POST requests fail via PHP, so I can't get any further than that.

-- Update --

I've converted the first few steps of Martin Doms' C# tutorial into PHP for anyone who's interested in doing this on their own site.

+4  A: 

Here's a nice 3-step tutorial: http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/

If you're having problems from PHP, then I think you should post the PHP code to see where it's failing. These steps should work flawlessly.

Seb
I actually started with that tutorial. And the problem with PHP isn't actually a problem with PHP ... it's a problem with authentication in general (possibly from my domain, but I'm not sure ...)I ported the C# code to PHP, and the issue occurs in the getSID() function. I can use the parsed URL (https://www.google.com/accounts...) directly in a web browser to return an SID and LSID, but both POST and GET requests via PHP throw an HTTP security violation.
EAMann
How are you doing those POST and GET from PHP? Using cURL function to do a GET should work just fine (http://us2.php.net/manual/en/function.curl-exec.php). If you're still having problems, posting your current code may help.
Seb
I'll try again with cURL and let you know what happens.
EAMann
cURL ended up being the magic that did the trick. After I was able to get the SID, the hardest step was passing a cookie in the GET request to return an auth token. Now everything's working beautifully, though. Thanks!
EAMann
Glad I could help! Don't forget to mark this answer as correct when you have the time ;)
Seb
I will ... it keeps telling me I have to wait. Right now it's down to 1 hour, so you'll have your bounty soon enough :-)
EAMann
Oh, forgot this one was a bounty one! Better yet! :) I always ask to mark as correct if they don't do it, so others can know which answer is *the* one pretty quickly.
Seb
I've also added a PHP version of Martin Doms' tutorial on my own site: http://mindsharestrategy.com/google-reader-api-a-brief-tutorial/
EAMann
The site went dead.. Anyone knows where can i find this tut (i'm more of a c# guy :) thanks.
Nimrod Shory
Here's another C# tutorial explaining the same process: http://sandrinodimattia.net/blog/post/Consuming-Google-(Reader)-with-NET-Part-1-Authentication.aspx
EAMann