#github #scraping #命令行工具 #上限 #cli #终端 #下限

app git-spy

高效的收集 GitHub 仓库的命令行工具

3 个版本

0.1.2 2020 年 8 月 6 日
0.1.1 2020 年 8 月 2 日
0.1.0 2020 年 7 月 25 日

#8 in #上限

MIT 许可证

37KB
561

logo

travisci license crates.io

演示

git-spy

先决条件

  • Chrome 或 Chromium

环境

mac linux windows

如何安装

cargo

cargo install git-spy

用法

git-spy VERSION
hibi221b
command-line tool to efficiently collect github repository

USAGE:
    git-spy

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

如何使用

$ git-spy
  • 此命令不需要参数
  • 您可以选择一种语言
  • rust, c, c++, go, swift, javascript, python, 等...

[2] 输入 GitHub 星标下限

  • 100, 500, 1000, 等...

[3] 输入 GitHub 星标上限

  • 上限需要大于下限。
  • 100, 500, 1000, 等... 或 *

[4] 输入主题

  • 您可以选择要搜索的主题
  • cli, web, gui, terminal, 等... 或无

[5] 确认无头模式

  • 按回车键:隐藏 Chrome
  • 按 n:可视化 Chrome

  _______   __  .___________.         _______. .______   ____    ____ 
 /  _____| |  | |           |        /       | |   _  \  \   \  /   / 
|  |  __   |  | `---|  |----`______ |   (----` |  |_)  |  \   \/   /  
|  | |_ |  |  |     |  |    |______| \   \     |   ___/    \_    _/   
|  |__| |  |  |     |  |         .----)   |    |  |          |  |     
 \______|  |__|     |__|         |_______/     |__|          |__|  
                        
                             https://github.com/hibi221b/git-spy

 language
rust <-------------------------------------------------------------------------------------- [1]
 lower bound of github star.
1000 <-------------------------------------------------------------------------------------- [2]
 upper bound of github star. (number or *)
* <----------------------------------------------------------------------------------------- [3]
 topic words.(cli, web, gui, terminal, etc...) If you don't need, press enter.
cli terminal command tool <----------------------------------------------------------------- [4]
▼ press enter: hide chrome, input `n`: visualize chrome
 <------------------------------------------------------------------------------------------ [5]
headless mode: true
search query:  language:rust stars:1000..* topic:"cli terminal command tool"

info: 27 repository results (The maximum number of repositories git-spy can get is 100)
info: hit 10 repositories
info: page 1/10
get:  https://github.com/alacritty/alacritty
get:  https://github.com/sharkdp/bat
get:  https://github.com/BurntSushi/ripgrep
get:  https://github.com/sharkdp/fd
get:  https://github.com/denisidoro/navi
get:  https://github.com/BurntSushi/xsv
get:  https://github.com/Rigellute/spotify-tui
get:  https://github.com/sharkdp/hyperfine
get:  https://github.com/imsnif/bandwhich
get:  https://github.com/sharkdp/hexyl
info: go to the next page

info: hit 10 repositories
info: page 2/10
get:  https://github.com/timvisee/ffsend
get:  https://github.com/svenstaro/genact
get:  https://github.com/XAMPPRocky/tokei
get:  https://github.com/imazen/imageflow
get:  https://github.com/fdehau/tui-rs
get:  https://github.com/sharkdp/pastel
get:  https://github.com/rustwasm/wasm-pack
get:  https://github.com/jmacdonald/amp
get:  https://github.com/vi/websocat
get:  https://github.com/gyscos/cursive
info: go to the next page

info: hit 7 repositories
info: page 3/10
get:  https://github.com/jhspetersson/fselect
get:  https://github.com/cloudflare/wrangler
get:  https://github.com/extrawurst/gitui
get:  https://github.com/chmln/sd
get:  https://github.com/killercup/cargo-edit
get:  https://github.com/redox-os/termion
get:  https://github.com/databricks/click

info: 27 repositories acquired. ($HOME/Downloads/git-spy-result/xxxxx.json)
info: scraping successfully finished.

结果

  • 创建 $HOME/Downloads/git-spy-result
  • 创建 $HOME/Downloads/git-spy-result/index.html
  • 创建 $HOME/Downloads/git-spy-result/XXX.json

打开 $HOME/Downloads/git-spy-result/index.html

  • $HOME/Downloads/git-spy-result/index.html
screenshot
  • $HOME/Downloads/git-spy-result/XXX.json
[
  {
    "url": "https://github.com/alacritty/alacritty",
    "repo": "alacritty",
    "desc": "A cross-platform, GPU-accelerated terminal emulator",
    "star": "24.1k",
    "keywords": "terminal-emulators macos gpu linux windows rust terminal opengl bsd vte"
  },
  {
    "url": "https://github.com/sharkdp/bat",
    "repo": "bat",
    "desc": "A cat(1) clone with wings.",
    "star": "21.1k",
    "keywords": "syntax-highlighting git rust cli terminal command-line tool"
  },
  ...
  ...
  ...
  {
    "url": "https://github.com/databricks/click",
    "repo": "click",
    "desc": "The \"Command Line Interactive Controller for Kubernetes\"",
    "star": "1.2k",
    "keywords": "rust cli kuberentes"
  }
]

依赖

~14–27MB
~439K SLoC