I want to create a "trending" page on my blog.
-
I want to create a "trending" page on my blog.
For example, the most-read posts in the last day / week / month / year / all time.
I've got the SQL query which will get that data.
But how should I present it in the URl?
VOTE NOW!
-
@Edent I think for SEO you’d want statistics URI over parameters.
-
@ben I'm not doing it for SEO - and would likely exclude those pages.
-
@Edent favorites?
-
@Edent Or `/trending/daily` `/trending/weekly` `/trending/monthly`
-
@Lionesslady I mean which *style* of URl do you like best irrespective of the naming?
-
@librenews I mean which *style* of URl do you like best irrespective of the naming?
-
@Edent restful way would (for your URL structure) `/blog?sort=trending&range=month&limit=100`
-
@librenews why do you prefer the RESTful style?
-
@Edent I'm not religious about it .For example, say you want to make JSON version of this available, the URL wouldn't change (the resource part of REST), you'd just send a different content-type in the header. REST really shines in cases like APIs where the URL `/subscriber` e.g. can use the HTTP verbs GET POST DELETE along with a path or param like `/subscriber/123` to indicate the specific subscriber. It helps developer consumers, but may or may not make a difference in many cases
-
OK, built a quick demo - most viewed posts on my blog by day, week, month, year, and all-time.
https://shkspr.mobi/blog/trending/
Feedback welcome!
-
@Edent Hey, slick!
Will you exclude hits with this page as the referrer?
-
@tychotithonus hahaha! I only track posts, not pages.