gistlog icon indicating copy to clipboard operation
gistlog copied to clipboard

Trending Gistlogs

Open adamwathan opened this issue 9 years ago • 5 comments

No idea on what the implementation would be, how things would be scored, or anything, but it would be cool if the home page could show trending posts so you can see what people are reading.

Could be an upvote system, view count, shares, who knows, but the general job story is something like:

When I'm looking for interesting tech writing to read, I want a way to discover posts that are getting a lot of attention, to help me keep up with what others are talking about in the tech community

adamwathan avatar Feb 24 '15 13:02 adamwathan

I think view count would be the easiest way to start. Hook into the Google Analytics API and just provide some information about most viewed posts in the last ___.

Cool idea.

mattstauffer avatar Jul 06 '15 02:07 mattstauffer

Hi @adamwathan and @mattstauffer I'm trying to implemented that functionnality, but I don't see how to test it locally, can you give me some hints please ?

Hermannovich avatar Feb 06 '17 09:02 Hermannovich

@Hermannovich That's a great question!

Since we're already relying on the JavaScript Google Analytics push--and since that's faster than doing a server-side push--it seems like it'll be tough to accurately test that.

My guess is that we instead take a look at our Google Analytics and make sure we know whether there's any diversity in the data--e.g. Do we get two separate page references for "gistlog.co/user/post" and "gistlog.co/user/post/"?-- and then make a stub that represents all the different cases we're expecting to get back from our data... we build a Google Analytics client that we use to read our data... and then in our tests we mock that client using the stub.

mattstauffer avatar Feb 06 '17 13:02 mattstauffer

Current plan:

  • Write a custom JS that feels very similar to the GA script
  • That custom JS will ping a local route
  • The local route will push the data up to GA via server push

This way we can get more accurate data, without introducing higher load times, in a way that will work even if we add whole-page caching down the road.

Additionally, we can scrape out only the data we care about, therefore limiting Google's ability to collect personal information.

From there, we can then build a really rudimentary local tool that interacts with Google Analytics' API via the Google SDK and can answer simple questions for us:

  • How many views were there on any URL in the last ___ days
  • What were the the top 10 URLs visited in the last ___ days, and how many page views did they get?

I think that alone merits a PR. From there we can work on design and planning for a trending gistlogs page, and decide what math we would want to use to understand "trending" (vs. just "lots of visits").

mattstauffer avatar Oct 19 '20 19:10 mattstauffer

I want to contribute to the issue please assigned it to me

ashvinichilbule avatar Oct 05 '23 06:10 ashvinichilbule