JQuery & JGFeed feed reader issue

SivaAnnaSivaAnna Registered Users Posts: 9 Big grins
Hello,

I am trying to write an jquery based utility (for my personal use) to read my keyword based pics ...

I read this site which says that with jgfeed plugin you can convert rssfeeds to json object to overcome the cross domain security issue - http://jquery-howto.blogspot.com/2009/05/google-feeds-api-jquery-plugin.html

The following is the feed that i want to read, for eg: which works fine alone

http://api.smugmug.com/hack/feed.mg?Type=userkeyword&NickName=sivaanna&Data=test&format=rss

Here is my observation:

Sample 1 - Works fine and responds with set of feeds as JSON object : http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://twitter.com/statuses/user_timeline/26767000.rss

but when i tried to do the same with smugmug feed, i get no data:

eg:

Query 1 -

http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://api.smugmug.com/hack/feed.mg?Type=userkeyword&NickName=sivaanna&Data=test&format=rss

response i get -

{"responseData": null, "responseDetails": "Feed could not be loaded.", "responseStatus": 400}

Query 2

basically same thing as 1s one but after escaping the special chars

http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://api.smugmug.com/hack/feed.mg%3FType%3Duserkeyword%26NickName%3Dsivaanna%26Data%3Dtest%26format%3Drss

response i get -

{"responseData": {"feed":{"feedUrl":"http://api.smugmug.com/hack/feed.mg?Type\u003duserkeyword\u0026NickName\u003dsivaanna\u0026Data\u003dtest\u0026format\u003drss200","title":"Siva Anna (sivaanna)'s 'test' tagged photos","link":"http://sivaanna.smugmug.com/keyword/test/","author":"","description":"#userBio {\r\n text-align: center;\r\n /*background-color: white*/\r\n}\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n","type":"rss20","entries":[]}}, "responseDetails": null, "responseStatus": 200}

any help would be appreciated.

Siva

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 26, 2010
    G'day Siva,

    As your Query 2 shows, you need to url encode SmugMug's feed url when passing it to the Google APIs otherwise the query parameters that we require get passed as parameters to the google request rather than to our request. You don't need to url encode the twitter feed since it doesn't require you to pass any query parameters.

    Hope that helps.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • SivaAnnaSivaAnna Registered Users Posts: 9 Big grins
    edited September 27, 2010
    David,

    Thanks for the clarification.

    My issue is - even if send the encoded URL to smugmug, i get the response with no pictures.

    For my keyword feed, i have one picture associated and it works fine if i enter the smugmug feed URL.

    Only that i get the response as above, when i try to encode the URL and try to use it with google api.

    Hope my explanation is clear and you understand my problem.

    Thanks
    Siva
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 27, 2010
    The reason why no results are returned is that the keyword 'test' is assigned to an image in an unlisted gallery.

    If you load the feed in a browser where you are actively logged in, it will return a result...however, if you make the same call from a browser logged out, no results will be returned...the same goes for when google loads SmugMug's feed.

    Hope this helps.

    David
    David Parry
    SmugMug API Developer
    My Photos
  • SivaAnnaSivaAnna Registered Users Posts: 9 Big grins
    edited September 27, 2010
    David,

    The response does not change - whether I have logged in to SM or not.

    The original SM feed URL -

    http://api.smugmug.com/hack/feed.mg?Type=userkeyword&NickName=sivaanna&Data=test&format=rss

    responds with the image results or not, depending on whether you have logged in or not (as you have mentioned).

    If I am not logged in , i get a clear message that there feed entries.

    The issue comes when I try to use this along with Google APIs.

    Thanks
    Siva
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 27, 2010

    There was an error rendering this BBCode post

    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.