如何使用JSON创建rss feed?

时间:2021-12-18 00:59:48

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

我想知道如何用json创建一个rss feed因为现在我要按照厨房水槽的例子来创建一个

can you guide me please

你可以指导我吗?

6 个解决方案

#1


7  

  1. Pick a programming language (I'd go with Perl as I know it and I know the modules that can do this)
  2. 选择一种编程语言(据我所知,我会使用Perl,我知道可以执行此操作的模块)

  3. Pick a JSON parser (I'd use JSON::Any)
  4. 选择一个JSON解析器(我使用JSON :: Any)

  5. Pick a module that can build an RSS feed (I'd use XML::RSS)
  6. 选择一个可以构建RSS提要的模块(我使用的是XML :: RSS)

  7. Get an HTTP client if you need it (LWP::Simple will probably do for this)
  8. 如果需要,可以获取HTTP客户端(LWP :: Simple可能会这样做)

  9. Write some glue code to stick them together.
  10. 写一些胶水代码将它们粘在一起。

#2


4  

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/

据我所知,rss总是XML。您应该将Json解析为正确的RSS结构。看看这个: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

这是rss的外观:http://www.landofcode.com/rss-tutorials/rss-structure.php

#3


2  

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

你没有。 RSS是一种基于XML的技术。

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.

RSS是XML的一种方言。所有RSS文件必须符合万维网联盟(W3C)网站上发布的XML 1.0规范。

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

您不妨问“我如何用JSON编写CSS文件?”

#4


1  

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.

如果你想构建和使用钛,就像在KitcheSink示例中那样使用XML,你需要使用XML。如果您有JSON,您可以自己解析它或使用Ti.Yahoo.yql将JSON转换为XML,然后使用与KitchenSink示例相同的Feed。

Ti.Yahoo.yql

#5


1  

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

RSS基于XML。您无法使用JSON创建一个

#6


0  

This link

should get you started using Json with php, however I'm trying to learn the same thing and I came across your post, so I'll be watching to see the results beyond what I can give right now.

应该让你开始使用Json与php,但是我正在尝试学习相同的东西而且我遇到了你的帖子,所以我会看到结果超出我现在可以给出的结果。

#1


7  

  1. Pick a programming language (I'd go with Perl as I know it and I know the modules that can do this)
  2. 选择一种编程语言(据我所知,我会使用Perl,我知道可以执行此操作的模块)

  3. Pick a JSON parser (I'd use JSON::Any)
  4. 选择一个JSON解析器(我使用JSON :: Any)

  5. Pick a module that can build an RSS feed (I'd use XML::RSS)
  6. 选择一个可以构建RSS提要的模块(我使用的是XML :: RSS)

  7. Get an HTTP client if you need it (LWP::Simple will probably do for this)
  8. 如果需要,可以获取HTTP客户端(LWP :: Simple可能会这样做)

  9. Write some glue code to stick them together.
  10. 写一些胶水代码将它们粘在一起。

#2


4  

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/

据我所知,rss总是XML。您应该将Json解析为正确的RSS结构。看看这个: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

这是rss的外观:http://www.landofcode.com/rss-tutorials/rss-structure.php

#3


2  

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

你没有。 RSS是一种基于XML的技术。

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.

RSS是XML的一种方言。所有RSS文件必须符合万维网联盟(W3C)网站上发布的XML 1.0规范。

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

您不妨问“我如何用JSON编写CSS文件?”

#4


1  

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.

如果你想构建和使用钛,就像在KitcheSink示例中那样使用XML,你需要使用XML。如果您有JSON,您可以自己解析它或使用Ti.Yahoo.yql将JSON转换为XML,然后使用与KitchenSink示例相同的Feed。

Ti.Yahoo.yql

#5


1  

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

RSS基于XML。您无法使用JSON创建一个

#6


0  

This link

should get you started using Json with php, however I'm trying to learn the same thing and I came across your post, so I'll be watching to see the results beyond what I can give right now.

应该让你开始使用Json与php,但是我正在尝试学习相同的东西而且我遇到了你的帖子,所以我会看到结果超出我现在可以给出的结果。