简体   繁体   English

新闻汇总

[英]News Aggregators

I need to create a news aggregator for our application, something similar to reading AP News from Yahoo, or something like http://popurls.com/ ; 我需要为我们的应用程序创建一个新闻聚合器,类似于从Yahoo读取AP News或类似于http://popurls.com/ the problem is that I don't know how it works. 问题是我不知道它是如何工作的。
So, a couple of questions: 所以,有几个问题:
1) How do I determine what news site to aggregate? 1)如何确定要汇总的新闻网站? Do I hard-code the specific site's url into the application? 我是否将特定网站的网址硬编码到应用程序中?
2) How do I know the url of the specific news? 2)我如何知道具体新闻的网址? It's one thing to know the site name, but another to know the url of the specific news. 知道网站名称是一回事,但知道特定新闻的网址是另一回事。
3) How do I embed the news content onto our application? 3)如何将新闻内容嵌入到我们的应用程序中?
4) How do I determine (without specifically hard-coding everytime) the category(ies) each news should go? 4)我如何确定(每次都没有特别硬编码)每个新闻应该去的类别?

Thank you very much for the help. 非常感谢你的帮助。

Generally there are software to do the aggregation and curation. 通常有软件来进行聚合和整理。 There are some interesting projects like http://topnow.in which is light weight and does pull only top content from a particular source. 有一些有趣的项目,例如http://topnow.in ,它的重量很轻,并且仅从特定来源提取顶级内容。 It depends on your requirement how you want to create the aggregator web site. 这取决于您的要求如何创建聚合器网站。

Nowadays there are many APIs provided by different news websites such as Hacker News, Google News. 如今,不同的新闻网站提供了许多API,如黑客新闻,谷歌新闻。 Google even has a news API which collects many news from different tech websites. Google甚至有一个新闻API ,可以从不同的技术网站收集许多新闻。

Basically you just need to query the data from these APIs regularly and formalize them in your own application and present them to the user. 基本上,您只需要定期查询这些API中的数据,并在您自己的应用程序中将它们形式化并呈现给用户。 The data returned by these APIs are usually JSON format, hence they are easy to process. 这些API返回的数据通常是JSON格式,因此很容易处理。

One very good example is the Technology Trend on The Earth application which collects news data from various sources and present them to the readers. 一个非常好的例子是“地球上技术趋势”应用程序, 应用程序从各种来源收集新闻数据并将其呈现给读者。

You can hardcode sites or request them from user (like iGoogle). 您可以对网站进行硬编码或向用户请求(例如iGoogle)。 After that you have to find the RSS url for the site and get the RSS for that site regularly (cron job can do it). 之后,您必须找到该站点的RSS URL并定期获取该站点的RSS(cron job可以这样做)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM