Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trending Gistlogs #41

Open
adamwathan opened this issue Feb 24, 2015 · 5 comments
Open

Trending Gistlogs #41

adamwathan opened this issue Feb 24, 2015 · 5 comments

Comments

@adamwathan
Copy link
Contributor

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

@mattstauffer
Copy link
Member

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.

@Hermannovich
Copy link

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 ?

@mattstauffer
Copy link
Member

@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
Copy link
Member

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").

@ashvinichilbule
Copy link

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

@faxblaster faxblaster removed their assignment Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants