当网站URL输入搜索框(而不是Feed网址)时,如何通过feedly从网站获取RSS订阅源的服务

时间:2013-10-13 12:13:19

标签: javascript jquery json rss

这可能是一个愚蠢的问题,不是一个完全与编程相关的问题,而是在我努力学习的过程中忍受。

FEEDLY如何通过在搜索框中输入网站网址来检索网站上的Feed /新闻。

例如,我在搜索字段中输入了http://www.inspirationfeed.com,并且传递的AJAX调用/查询字符串是

http://cloud.feedly.com/v3/search/feeds?q=http%3A%2F%2Finspirationfeed.com%2F&n=20&ck=1381664838936

它返回了一个JSON作为响应

{"results":[{"deliciousTags":["Design","inspiration","Diseño","Web Design","webdesign","graphic design"],"lastUpdated":1381561980000,"score":27531.265625,"website":"http://inspirationfeed.com","title":"inspirationfeed.com","subscribers":1772,"language":"en","velocity":16.3,"feedId":"feed/http://feeds.feedburner.com/inspirationfeed/BTLD","description":"be inspired!"},{"deliciousTags":["DESIGN","Inspiration"],"lastUpdated":1381474380000,"score":48.0,"website":"http://inspirationfeed.com","title":"inspirationfeed.com » Inspiration","subscribers":48,"language":"en","velocity":4.7,"feedId":"feed/http://inspirationfeed.com/category/inspiration/feed/","description":"be inspired!"},{"deliciousTags":["design"],"lastUpdated":1381479900000,"score":294.7439270019531,"website":"http://inspirationfeed.com","title":"inspirationfeed.com » Articles","subscribers":27,"language":"en","velocity":11.7,"feedId":"feed/http://inspirationfeed.com/category/articles/feed/","description":"be inspired!"},{"deliciousTags":["Photography"],"lastUpdated":1381129620000,"score":17.0,"website":"http://inspirationfeed.com","title":"inspirationfeed.com » Photography","subscribers":17,"language":"en","velocity":0.7,"feedId":"feed/http://inspirationfeed.com/category/photography/feed/","description":"be inspired!"},{"deliciousTags":["Little Bit of Everything-Amatuer"],"lastUpdated":1381396020000,"score":109.16442108154297,"website":"http://inspirationfeed.com","title":"inspirationfeed.com » Blogging","subscribers":10,"language":"en","velocity":0.5,"feedId":"feed/http://inspirationfeed.com/category/articles/blogging/feed/","description":"be inspired!"}]}

我理解的是什么

1)基于密钥deliciousTags,以feedly方式生成#标签 2)根据密钥score,以自上而下的顺序排列网站提供的不同供稿/新闻网址

我没有理解

1)如何通过输入网站网址(示例: "feedId":"feed/http://feeds.feedburner.com/inspirationfeed/BTLD")来获取新闻Feed / rss网址

2)需要为这样的事物编写什么类型的Web服务。是否需要服务器端脚本来深入搜索相关网站并检索提要URL?可以使用JQuery / Javascript在客户端本身获取提要URL吗?

再次感谢您花时间阅读问题。

1 个答案:

答案 0 :(得分:6)

在页面html的头部有一个带有rss / atom feed的网站链接,如下所示:

<link rel="alternate" type="application/atom+xml" title="Feed for question &#39;how does a service like feedly obtain the rss feeds from a website when the website URL is entered into the search box(not the feed url&#39;" href="/feeds/question/19345075">

这是此问题页面的来源

Feedly或类似服务搜索该页面的html(而不是主机),并找到此链接标记(使用rel,类型):<link rel="alternate" type="application/atom+xml" title="awd" href="/feedUrl"><link rel="alternate" type="application/rss+xml" title="awd" href="/feedUrl">(还有更多内容)

并且还有一些设置Feed网址的例程,

  • http://<url>/rss
  • http://<url>/feed
  • http://<url>/atom
  • http://<url>/<page>.xml

如果没有找到,那么那里什么都没有!

可以在服务器端和客户端完成,但在服务器端,在解析页面html和测试例程之前,还有更多好处,如数据库搜索。

默认情况下,Firefox有一个获取页面提要的选项,以前的chrome版本具有此类功能,但它已被谷歌(和谷歌方式)删除。 (这是浏览器端,由用户控制和拥有,不能被网站使用!但你可以找到他们实现这种方法的方式)