Giter VIP home page Giter VIP logo

useful-forks / useful-forks.github.io Goto Github PK

View Code? Open in Web Editor NEW
1.1K 10.0 60.0 11.49 MB

Improving GitHub's Forks list discoverability through automatic filtering. The project offers an online tool and a Chrome extension.

Home Page: https://useful-forks.github.io/

License: MIT License

JavaScript 75.44% CSS 3.58% HTML 20.98%
github github-api chrome-extension chrome-extensions fork forked forks forks-insight forked-repo github-forks

useful-forks.github.io's Introduction

useful-forks banner

Useful Forks

License Issues


This tool enhances the discoverability of useful forks for open-source projects by providing a list of forks worth exploring.

The results are filtered to exclude forks that have never had any commits pushed to the main branch since their creation.

Sometimes, a project might be abandoned, or someone had a different idea of how it should be implemented... and when you go looking for those interesting forks, you find yourself searching through potentially hundreds of them. This tool is here to help you discover the hidden jewels you were looking for!

Table of Content


Releases

There are several ways to access the tool.

If you use Chrome, your best option would be to download the Chrome extension. For other browsers, you may want to use the bookmarklet.

Online tool

The project is available online for free thanks to GitHub Pages.

You can query a repository directly with the URL. Click this link to get an example: https://useful-forks.github.io/?repo=payne911/PieMenu.

Below is a recording of what a scan would look like:

website example

Chrome extension

Head to Chrome's Web Store to install the published extension.

Once it's activated, the extension will automatically add a new "Useful" button on all GitHub repository pages:

extension_btn

Here is what happens when you click it:

example

This button will only appear when you visit GitHub repositories, and clicking it opens a new tab that will automatically trigger a search using the online tool.

Please note that this project will not be updating the GitHub Releases page anymore. We will now go through Chrome's Web Store to publish updates.

Refined GitHub

Refined GitHub is an ensemble of tools and tweaks aimed at improving your GitHub experience.

useful-forks is part of the hundreds of features provided. In that context, it appears as a button which redirects you to the Useful Forks website:

insights_screenshot

It also appears next to the archive notification:

archive_screenshot

Bookmarklet

The online tool can be used as a bookmarklet. To add one manually, press Ctrl+D to create a new bookmark and add this code in the URL field:

javascript:!function(){if(m=window.location.href.match(/github\.com\/([\w.-]+)\/([\w.-]+)/),m){window.open(`https://useful-forks.github.io/?repo=${m[1]}/${m[2]}`)}else window.alert("Not a GitHub repo")}();

When you're viewing a GitHub repo in your browser, you can press the newly created bookmarklet and this will open the online tool for the repo in a new tab.

How it works

Activity_Diagram

This Activity Diagram (UML) should clarify a bit the inner-workings of the algorithm, and why it may some times require so many API calls.

Contributing

If you want to help, the structure of the repo is rather simple. In terms of folders:

  • website contains the website
  • plugin contains the Chrome Extension

Website instructions

To run the website locally, you will need:

  • NodeJS (suggested v14.15+)
  • NPM (suggested v6.14+)

Bring a terminal to the website folder and execute npm install, and then npm run dev.

If after running npm run dev you get an error that mentions "code: 'ERR_OSSL_EVP_UNSUPPORTED'", this should be able to help.

Whenever you want to test changes to the src/queries-logic.js file, you will need to re-execute npm run dev for dist/main.js to recompile.

Credits

  • Thanks to raeleus for his design of the logo!
  • Thanks to jkunstwald for allowing me to apply the MIT license to what has been expanded from his own initial work. Here is a list of the improvements that were made:
    • Recursive search of all sub-forks
    • GitHub API's Watchers value is bugged so it was removed
    • Implement authenticated requests to the GitHub API (which increases the limit of calls)
    • Added some minimal feedback for certain edge-cases
    • Created an actual website for the feature
    • The Chrome extension leads to the (more powerful) website
  • Thanks to star-history's open-source website which I adapted for this project

useful-forks.github.io's People

Contributors

awkwardpeak7 avatar dependabot[bot] avatar ethkuil avatar fregante avatar ibob avatar jkunstwald avatar lucaslarson avatar odnar-dev avatar payne911 avatar warningimhack3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

useful-forks.github.io's Issues

Sorting algorithm is wrong

The very first row to be appended to the table is not taken into account by the current sorting algorithm:

image

The algo that is found in 2 different places (the Chrome Extension, and the Website):

function getTdValue(rows, index, col) {
  return rows.item(index).getElementsByTagName('td').item(col).getAttribute("value");
}

/** 'sortColumn' index starts at 0.   https://stackoverflow.com/a/37814596/9768291 */
function sortTable(table_id, sortColumn){
  let tableData = document.getElementById(table_id).getElementsByTagName('tbody').item(0);
  let rows = tableData.getElementsByTagName('tr');
  for(let i = 0; i < rows.length - 1; i++) {
    for(let j = 0; j < rows.length - (i + 1); j++) {
      if(getTdValue(rows, j, sortColumn) < getTdValue(rows, j+1, sortColumn)) {
        tableData.insertBefore(rows.item(j+1), rows.item(j));
      }
    }
  }
}

[Feature Request] Search by number of commits

Searching with commits helps when there's a huge number of repositories that have less commits , like 10 or 20 which are easily not the best option

There was an issue for this
isaacs/github#1206

I built a code pen for this https://codepen.io/wakaztahir/pen/YzRVzZz?editors=1000

It doesn't work properly at the moment since Github doesn't support this , It could work if a little effort could be put into it

I would also like to support maximum stars to limit displaying popular repositories that I've viewed thousand times , So repositories with many commits and less stars tend to be secret gems.

Allow users to manually abort

Potentially:

  • When reaching 80% of the remaining Rate Limited calls
  • Turn the "loading" button red and if clicked: abort

A proposed implementation was made there: #7 (comment)

API calls counter

It could be interesting to provide a real-time counter of the amount of GitHub API calls:

  • amount issued for the current query
  • amount left on the current token
  • approximated amount ?

The approximated amount would be displayed at some point before the query begins.

estimate = 1 + total_forks + (total_forks / 100) + (sub_forks_probability * total_forks)

A warning could be issued if that value exceeds the maximum amount of API calls that can be made within an hour with the current token.

Duplicate results

Not sure if this is to be expected somehow, but I noticed nothing in the Issues about this: I'm getting lots of duplicate results displayed, the same lines with the same values. When exported to csv, it is the same.

For example, the file useful-forks-https\ __github.com_zyedidia_micro_.csv has 104 lines (including the header), while with duplicate lines removed, it only has 59.

Support resuming

I did run useful-forks on repo that has >5000 forks, and naturally got GitHub API rate-limits exceeded. It would be nice if there would be a way (button?) to resume scanning after waiting long enough to be no longer blocked on API calls. I tried editing access token to re-save it, but it did not resume activities.

Broken link in README

The link for open source website in :

Thanks to star-history's open-source website which I adapted for this project

leads to a 404 Github page

[Feature request] Cache results

It would be great if there was a way to cache the results since they take a long time to generate and require a lot of API calls.

The spinner is removed before the loading is completed

Example URL to test with: https://useful-forks.github.io/?repo=EsotericSoftware/kryonet

The spinner is removed from the button before the recursive exploration of the whole tree of repositories is completely explored and filtered.

This spinner is supposed to act as visual feedback to the user so that he may know when the whole process is done. It also prevents overriding the current work with some other search (simultaneous searches could cause problems).

Small screens get a weird table

I'm not sure people actually use this tool on their phone, but it would be nice to cover that edge-case. I think it could be solved by using <span> and flex-box.

This is rather low on the priority list, though.

image

Highlight dates when relevant

When the date of a displayed fork is more recent then the one for the queried repository, highlight it (kind of like behind is green when the value is 0).

Provide sorting options

Hello there! Thank you for a fantastic addition to Github!
It is making life so much easier than doing it with shell magic and parsing the DOM ...
With that being said:

I am mostly interested on the projects that have the most modifications. And I can imagine different people might want to try different things based on different criteria.

Exposing more of the sorting options would be a nice addition to this nifty tool!

Warn when search isn't starting from root

Some times you might accidently start your search from a fork and the algorithm will only look into its children, thus potentially leaving a good portion of the fork graph out of the exploration.

Having a way to get the user to be aware that they are not querying a repo which is the root of the tree could be a nice addition.

Additionally, providing a single-click solution that would allow them to search from the root (or the direct parent?) would be nice.

Listed forks should link to the "compare" page

Example link: https://useful-forks.github.io/?repo=facebook/sapling
image

I realized that when I go to explore a repository, I don't really care about the repo's landing page (e.g. landing page: https://github.com/mayhemheroes/eden).

Taking the last fork listed as an example, maybe that link should open facebook/sapling@main...mayhemheroes:eden:main instead of https://github.com/mayhemheroes/eden

Or maybe the "ahead" and "behind" badges could be those links.

I'd love to hear some thoughts about this.

Add a userscript version of the Chrome extension

just added this to the top of the script and it worked on Violentmonkey firefox

// ==UserScript==
// @name        Useful Forks
// @namespace   https://github.com/useful-forks
// @match       *://github.com/*/network/members
// @grant       none
// @version     1.5
// @icon        https://useful-forks.github.io/assets/useful-forks-logo.png
// @author      Useful Forks
// @description Displays GitHub forks ordered by stars, and with additional information and automatic filters.
// @require     https://code.jquery.com/jquery-3.5.1.min.js

// ==/UserScript==
// put the script down here !!

Keep forks with commits to non-default branches

1k thanks for this tool :-)

Relevant work on a fork can be hidden in a non-default branch, if for example the author planned to submit a PR properly, but eventually didn't.

Would it be useful here to also check for such branches (not just the default branch), and keep forks in the results list, if any are found?

I've implemented such logic a while ago in a similar tool. While I can't port it to JS, I hope the example is still helpful to consider this idea.

The increased number of API calls can be mitigated, if necessary.

Please add last commit date

It would be useful to see when the last commit was made.

Even better would be to see the date of the last upstream commit as well, because "70 commits behind" say nothing about dates. But not sure how difficult it will be.

Add a link back to github

Great tool. Thanks! I finally don't have to scroll through the giant graph where I don't know what's what.

Quick suggestion, would be nice to add link back to the original project too. Perhaps add it at the top in the table?

The queried repository has too many forks

I have hit this unfortunate message

It's also possible that the queried repository has so many forks that it's impossible to scan it completely without running out of API calls. :(

while scanning https://github.com/dbeaver/dbeaver.

I would gladly give up some Local Storage in order to be able to fully scan a repo.

I will just give my whole thought process, even though it might be complicated to do it in one go:

  1. Keep API calls counter #7, number of API calls still available, and API limit refresh time
  2. Store all inactive forks in a cache for a some time (e.g. 1 week).
    Add a tooltip on the side of the page "Skipping x number of forks because they are empty [reset cache]"
  3. When the number of API calls still available is zero, start the API limit refresh timer as a countdown
  4. Store the current results in cache, with their fetch timestamp (e.g. for 1 day)
  5. Add/Enable a button [continue fetching] when the [API limit refresh time reaches zero | it is detected that there are API calls available]

and lastly,

I don't know how feasible it is (it doesn't look like it), but server-side caching shouldn't be too much (I don't think that table would be too much to store as JSON), and might help "fight" the scourge empty forks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.