how to create an rss feed using JSON? [closed]
Asked Answered
D

5

5

I like to know how I could create a rss feed with json because right now I got to create one by following the example of kitchen sink

can you guide me please

Dada answered 4/5, 2011 at 9:43 Comment(1)
Sabrina when you ask questions on here try and be as precise about everything as possible and search here and Google first to see what you find before asking. Please also try and include code whenever you talk about it so in this example you mentioned the KitchenSink. Link to the specific part of the KichtenSink you're asking about so we can give you the best answer possible. If you'd of searched you might have found these first. https://mcmap.net/q/757906/-convert-rss-to-json-closed and #5555933 Both of those could help.Durarte
L
9
  1. Pick a programming language (I'd go with Perl as I know it and I know the modules that can do this)
  2. Pick a JSON parser (I'd use JSON::Any)
  3. Pick a module that can build an RSS feed (I'd use XML::RSS)
  4. Get an HTTP client if you need it (LWP::Simple will probably do for this)
  5. Write some glue code to stick them together.
Lamkin answered 4/5, 2011 at 9:47 Comment(3)
thank you for your answer but as I use Appcelerator's gonna be like the javascript code I need a small example it would be nice because I really begins in the Programming and with AppceleratorDada
The principle is the same. You need to get the data, parse it, then generate the XML. If you've got problems with one of those steps, I suggest you ask a new and more specific question.Lamkin
I just have a little example to see how it looks readyDada
S
5

as far as i know, rss is always XML. You should parse the Json to a correct RSS structure. check this out: http://www.xn--schler-dya.net/blog/2008/01/26/converting-json-to-xml-and-xml-to-json/

here is how rss should look: http://www.landofcode.com/rss-tutorials/rss-structure.php

Storyteller answered 4/5, 2011 at 9:51 Comment(1)
thank you I know how the structure looks like flux rss I am asked to create an RSS feed using json, but I really do not know what to do over I can not see what is the difference between the two methodsDada
S
2

You don't. RSS is an XML-based technology.

RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website.

You might as well ask "how can I write a CSS file with JSON?"

Saturn answered 4/5, 2011 at 13:47 Comment(1)
Funnily enough, json is closer is syntax to css than xml will ever be :)Allain
D
0

Using titanium if you want to build and XML like the one in the KitcheSink example you need to use XML. If you have JSON you could parse it yourself or use the Ti.Yahoo.yql to conver the JSON to XML then do the feed the same as the KitchenSink example.

Ti.Yahoo.yql

Durarte answered 4/5, 2011 at 15:23 Comment(2)
thank you for all that information but meToi data in an xml file and am asked to code with jsonDada
you can still use Ti.Yahoo.yql to convert from XML to JSON then.Durarte
E
0

RSS is based on XML. You cannot create one using JSON

Enginery answered 5/5, 2011 at 4:31 Comment(1)
I did not know it, yet I was given a little code that I have not tested yetDada

© 2022 - 2024 — McMap. All rights reserved.