3 ms·
You can ... kind of ... use Algolia in this way. It's pretty easy to search for the top submissions of the past day, week, month, or year: Day: https://hn.al
by dredmorbius 4y ago
You can ... kind of ... use Algolia in this way. It's pretty easy to search for the top submissions of the past day, week, month, or year:
Day: https://hn.algolia.com/?dateRange=last24h&page=0&prefix=false&query=&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=last24h&page=0&prefix=fals...
Week: https://hn.algolia.com/?dateRange=pastWeek&page=0&prefix=false&query=&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=pastWeek&page=0&prefix=fal...
Month: https://hn.algolia.com/?dateRange=pastMonth&page=0&prefix=false&query=&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=pastMonth&page=0&prefix=fa...
Year: https://hn.algolia.com/?dateRange=pastYear&page=0&prefix=false&query=&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=pastYear&page=0&prefix=fal...
I really wish there were an easier way to list top stories for a specific period --- month or year would be good. Algolia does have a date-range-picker, but like many, it's cumbersome. It also generates date specifiers based on Unix timestamps (seconds since 1970-1-1). So here's the Best of 2012:
https://hn.algolia.com/?dateEnd=1356912000&dateRange=custom&dateStart=1325376000&page=0&prefix=false&query=&sort=byPopularity&type=story https://hn.algolia.com/?dateEnd=1356912000&dateRange=custom&...
That is:
https://hn.algolia.com/?dateEnd=1356912000&dateRange=custom&dateStart=1325376000&page=0&prefix=false&query=&sort=byPopularity&type=story
Where:
dateEnd=1356912000
dateStart=1325376000
I've suggested using a shell script to generate URLs of interest. This could also of course be done in JS or the programming tool of your choice:
for i in {5..15..5} do
echo "https://news.ycombinator.com/front?day=$( date -d "$i years ago" +%Y-%m-%d )"
done
(See earlier: https://news.ycombinator.com/item?id=28806795 https://news.ycombinator.com/item?id=28806795)
There's also the "past" link, which can be used to show any one day's top stories: https://news.ycombinator.com/front https://news.ycombinator.com/front