hedyhli / starcli

:sparkles: Browse trending GitHub projects from your command line
https://pypi.org/project/starcli/
MIT License
547 stars 50 forks source link

Use gtrending for fetching GitHub trending instead of scraping the web #82

Closed hedyhli closed 3 years ago

hedyhli commented 3 years ago

Description

Using the gtrending library you can fetch trending repositories (and developers) by language, spoken language, and since (date range), we can replace this function in search and use the API from that instead.

Note that

  1. the keys (repo["stargazers_count"] etc) are different, so we would need a helper function to change the keys into the keys github uses.
  2. We might have to sort the order asc or desc ourselves after the repo list is returned.

Also notice how the wording is a bit different since and the current date-range, so it would be good to rename the CLI option as well to keep the wording the same. Don't forget to update the CLI tests when renaming the options.

And don't forget to update the requirements.txt and setup.py install requires because we don't need BeautifulSoup, lxml anymore, and add gtrending.