Giter VIP home page Giter VIP logo

sort-awesome-lists's Introduction

sort-awesome-lists

Sort awesome lists by the number of stars in each GitHub repository, for each sub-heading / section in the list.

For example:

This is a CLI application written in Go and uses 0 external dependencies.

Sorting by stars implies parsing the original awesome-list README.md file and outputting a modified version where each section is sorted in descending order by the number of stars (for each valid github repository).

GitHub repository detection involves checking each markdown bullet point if it contains a username.github.io/repo or github.com/username/repo link. Otherwise, if a project website is linked, the application will attempt to download and parse the webpage to check if a GitHub repository link exists within the HTML.

How to use

sort-awesome-lists is a CLI application. Build it and run in your terminal.

Building

go build -o sort-awesome-lists main.go

Creates an executable file called sort-awesome-lists in your directory. Run in your terminal with ./sort-awesome-lists

Usage

Usage of sort-awesome-lists:
  -bs int
        number of concurrent requests to send to GitHub API at a time, per each block found. (default 5)
  -o string
        name of file to write output to if set, otherwise prints to stdout
  -t string
        GitHub personal access token
  -v    prints debug messages to stdout if true (default = false)

A GitHub personal access token is required by the -t flag as this CLI application hits the GitHub API for repository statistics. The token allows one to access the GitHub API at a rate-limit of 5000 requests per hour. A personal access token with 0 permissions checked can be generated and used (go here to create one if you don't already have one: https://github.com/settings/tokens)

This tool currently supports username.github.io/repo and github.com/username/repo detection.

Example:

./sort-awesome-lists -t="$token" -o="awesome-go-sorted.md" https://raw.githubusercontent.com/avelino/awesome-go/master/README.md

where $token is your github personal access token.

The above example will download and parse the markdown file from https://raw.githubusercontent.com/avelino/awesome-go/master/README.md, and output a sorted markdown output in a file called awesome-go-sorted.md in the same working directory.

Known Issues / Gotchas

For entries in a list that do not directly link to github.com/username/repo or username.github.io/repo, the webpage will be downloaded and parsed to check if a GitHub repository link exists within the HTML. This means that this tool will be unable to pick up any links for websites that use a JavaScript framework and require JavaScript to render the page.

sort-awesome-lists's People

Contributors

kvnxiao 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

Watchers

 avatar  avatar  avatar

sort-awesome-lists's Issues

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.