views:

35

answers:

3

How do you know what are the top stories or hot topics just in RSS feed aggregator NewsNow for example??

Could you please explain?

I am new to Ruby on Rails. I want to build a RSS reader in Ruby on Rails. Could you suggest me some good tutorials or links??

Thanks

Gautam

+1  A: 

The gem feedzirra is a good gem to look at.

Sardathrion
+1  A: 

"Heat" in reference to hot topics, hot stories, etc is usually a calculation of popularity over time. You might want to apply some modifiers to each value but lets go simple and say it's total reads / age in minutes

Something read 200 times in 1 minute is hotter than something read 2000 times in 15 minutes.

How you implement this is a different question. It's not something you can really do with a database without pulling all the data out so it might be better to keep statistics (ie its primary key, publishing time, and total reads) in a local quick-access store (memcache et al) so you can pull them out, sort based on the data you need and cache that for 5-10 minutes.

You can also improve processing time by limiting the ranking to news items published within a certain period (depending on your news throughput).

Oli
A: 

Since I couldn't tell from your question if you were building an RSS feed that lists yoru site's hot topics or an RSS reader that determines hot topics in other sites, i'll answer both:

There are many ways to interpret what a hot topics is. In this answer, consider a hot_topic to be a news post that has the most views (you could build your own approach to popularity and make it more complex, such as views per minute, but that's an exercise I'll leave for you):

If you're trying to build an RSS feed that lists the most hot topics in your site, you can:

  • Add a column to your model that saves how many 'views' it has. You could track how many views it has, for example, by incrementing the value (post.views += 1) each time the post is watched and then saving it (post.save).
  • After creating an action in your controller for hot_topics, you simply order your posts by views.

This is a simple way to present an RSS with the most views.


Now, if you're trying to build your own RSS READER that reads popular posts from other websites or tries to determine popularity across different websites, then you can either:

  • Download the RSS feed hot_topics from that specific site if it has any (such as Newsnow)
  • Crawl different websites and compare which are popular on both and sort them to your reader

I hope this helps.

Andres