Top Posts - Getting List on another page


(Scott Trager) #1

Is there a way to get the Top Posts (listed at site/top or site/top/monthly) on a different page (specifically i’m making a sidebar for it) - I can do it by framing in another copy of the page, but that’s obviously not the right way to go about doing it. Does anyone know if there is a way to call the table up elsewhere?


(Jeff Atwood) #2

You can get the RSS feed and do what you will with it, or get the Json (add .json to the end of any URL on the site) and do the same.


(Scott Trager) #3

There’s an RSS feed? I don’t see the icon anywhere…


An RSS icon is needed
(Jeff Atwood) #4

View source if you don’t believe me!


(Scott Trager) #5

Well that’s odd… I view source here on Meta and there is an RSS, but when I do it on our own site there is no RSS line on any page. (example /top/monthly) - Do I need to install a plugin or something first?

EDIT: I was able to find it by going to latest.rss - is this the only feed, or are there feeds for the other pages?


(Scott Trager) #6

Just an update - I found RSS feeds for individual categories and for the main page only. I couldn’t find a way to pull an RSS for /top (or /top/monthly etc.) and the .JSON files while apparently valid according to several validators only returns whitespace when I try to parse it out (I tried like 10 different scripts) :frowning: - I have experience working with RSS and Atom and would highly prefer to use it, but I’ll also take an example that can read the JSON file at /top/monthly.json if someone happens to know how to get data out of it.


(Jeff Atwood) #7

Not sure top makes sense as an RSS feed now that I think about it – it would constantly be changing every day in unpredictable ways (the opposite of a news feed which is strictly by date of news). I suggest sticking with the json.


(Scott Trager) #8

That seems to be the consensus. Thanks.