2

I'm writing an api for google reader where I'm currently trying to get items belonging to a specific inputted feed. In order to get the information i am using the following code:

String url = String.Format("http://www.google.com/reader/atom/feed/{0}?n=5000", inputtedURL); 

The information returned is in XML format. Is there a way where I can specify the output to be in JSON format in the url itself? Or else, is there an assembly reference (library) in C# which can perform this conversion please?

thanks for your help :)

Mark Coleman
  • 40,542
  • 9
  • 81
  • 101
ict1991
  • 2,060
  • 5
  • 26
  • 34

6 Answers6

2

You can get a feed as JSON from the Google Reader API by using http://www.google.com/reader/api/0/stream/contents/feed/<feed_url>.

Mihai Parparita
  • 4,236
  • 1
  • 23
  • 30
1

Take a look at Json.net

Rajeev Shenoy
  • 910
  • 6
  • 13
  • [Help link for XML/JSON conversion](http://james.newtonking.com/projects/json/help/ConvertingJSONandXML.html) – snurre Dec 28 '11 at 13:35
  • While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Dec 28 '11 at 13:41
1

I don't know of an native c# library that can do it but here is a couple of methods to do it for you.

XML to JSON

Ryand.Johnson
  • 1,906
  • 2
  • 16
  • 22
  • While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Dec 28 '11 at 13:41
1

Why don't you just parse your XML and serialize into a json file?

André Perazzi
  • 1,039
  • 2
  • 11
  • 27
0

see:
http://www.thomasfrank.se/xml_to_json.html
http://davidwalsh.name/convert-xml-json

4b0
  • 21,981
  • 30
  • 95
  • 142
  • While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the links for reference. – Bill the Lizard Dec 28 '11 at 13:38
0

Have you tried appending "&output=json" to the querystring? The tutorial for the API has an example.

Arbiter
  • 984
  • 1
  • 10
  • 24