Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. From the command-line, use the following and you'll be prompted for your password:

    Code Block
    # Supply username to search private repos
    curl --user "REPLACE_WITH_GITHUB_USERNAME" https://api.github.com/search/code?q=edx-drf-extensions+org:edx
    curl --user "REPLACE_WITH_GITHUB_USERNAME" https://api.github.com/search/code?q=REPLACE_WITH_SEARCH_TERM+org:edx
    
    # Skip username to quickly search public repos
    curl https://api.github.com/search/code?q=edx-drf-extensions+org:edx


  2. If you have jq installed (e.g. brew install jq), you can get a sorted/filtered list using the following:

  3. Code Block
    # Pipe results to jq to get a filtered list of repositories
    curl -s "https://api.github.com/search/code?q=edx-drf-extensions+org:edx" 2>&1 | jq "[.items[].repository.full_name] | unique"
    
    # Note: Add '--user "REPLACE_WITH_GITHUB_USERNAME"' like above to search private repos.


  4. Or, use jq-play online to filter the output:
    1. Copy the search output into the JSON field inĀ https://jqplay.org/
    2. Enter the following filter in jq-play:

      Code Block
      .items[].repository.full_name


Github API from Python

Info

This script has the advantage of sorting and filtering results to the unique set of repositories.

...