up-for-grabs.net icon indicating copy to clipboard operation
up-for-grabs.net copied to clipboard

Sort by Recently updated

Open ritwik12 opened this issue 6 years ago • 12 comments

As per @AllanOcelot in #1140, it will be good to have a sort by recently updated or most active for projects.

ritwik12 avatar Jan 21 '19 18:01 ritwik12

Hey @ritwik12 - Just breaking down this, since we don't have timestamps on the project information. I believe we will be tracking down by using GH APIs Maybe recently updated by hitting each repository on GH to pull down the latest PRs merged for a given week/month and sort accordingly? Hence, just a popup question, are there any keys to be stored somewhere for GH interaction in the project?

Zarad1993 avatar Jan 28 '19 16:01 Zarad1993

@Zarad1993 Yes, we need to hit GH for this for each repository and collect the last updated time for a repo. What we can do is to collect last updated time of each repo in a file and just sort that file based on recently updated. I guess mapping based on key for projects and their recently updated time is very much needed. Doing all this from scratch will not be so easy so I will recommend using some pre built tool or API which can do this and then map projects accordingly.

ritwik12 avatar Jan 29 '19 18:01 ritwik12

@Zarad1993 Since it could be a big feature request so it'll be good to break it down in steps so that help from others could also be taken if required.

ritwik12 avatar Jan 29 '19 18:01 ritwik12

Few references for this: https://serverfault.com/questions/401437/how-to-retrieve-the-last-modification-date-of-all-files-in-a-git-repository

https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository

https://github.com/google/go-github/issues/821

ritwik12 avatar Jan 29 '19 18:01 ritwik12

@AllanOcelot It will be good to have your reviews on this issue time to time.

ritwik12 avatar Jan 29 '19 18:01 ritwik12

Thanks @ritwik12 . Just a note since we don't have specific key values for repo and owner We do store the Site's github URL and that is just assuming the Sites that exist on GH and not other sources.

Zarad1993 avatar Jan 30 '19 11:01 Zarad1993

@Zarad1993 Yeah, also not all site URL are github repo URLs but approx 80-90 percent URL are github URLs.

ritwik12 avatar Jan 30 '19 17:01 ritwik12

Hello guys. I'm new here and new to contributing to OSS in general. I would like to suggest using the Github Rest API v3. A simple GET request can return all info about a repo, including "updated_at" and "pushed_at". For example, https://api.github.com/repos/up-for-grabs/up-for-grabs.net returns all the info about this repository.

savvaspc avatar Jan 31 '19 21:01 savvaspc

Update: It looks like Github API allows 60 requests/hour for unregistered requests. Using some form of OAuth can raise this to 5000/hour.

Anyway, I have created code in projectsService.js that gathers all projects with github urls, sends the requests and processes the responses to add a ''lastUpdateTime" field in _projectsData.projects[i]. I'm now working on sorting the array based on these timestamps and after that I think I will upload the code on my fork for you to see it. I haven't done anything about the html part (maybe we can add a "sort by recently active" button with a warning that some projects might not support this feature). So far, I'm not very familiar with how the data is being presented on screen.

savvaspc avatar Feb 01 '19 18:02 savvaspc

@savvas94 This looks good, Please send a PR for this for whatever you have done till now and make checks checklists for adding more code. It'll be good to do it step wise so that you'll not spend lots of time doing something different.

ritwik12 avatar Feb 06 '19 08:02 ritwik12

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 16 '19 12:10 stale[bot]

Hello, I am looking to contribute to an open source application as a part of my final project for a course. I have a team of five members, and I see many open issues currently. I wanted to know if this issue is active and if I can work on it?

mrahmatu avatar Nov 17 '23 06:11 mrahmatu