Coder Social home page Coder Social logo

list-saved-searches's Introduction

A short script to list users and organizations that have saved searches, and the number of saved searches associated with each user or org.

Note: This script works for Sourcegraph instances before version 3.0.0.

To run:

  1. Clone this repository and cd into it.
  2. Run pipenv install
  3. Create a Sourcegraph access token at https://$YOUR_SOURCEGRAPH_INSTANCE_URL/users/$USERNAME/settings/tokens. The user associated with the token should be a site admin of the Sourcegraph instance you are querying.
  4. Run pipenv run python list-saved-searches.py https://$YOUR_SOURCEGRAPH_INSTANCE_URL $YOUR_SITE_ADMIN_ACCESS_TOKEN.

Running the script will output the users and organizations that have saved searches associated with them, and the number of saved searches associated with each:

Username      # saved searches
----------  ------------------
beyang                       2
ryan                         1
sqs                          2
felix                        1
keegan                       1
ijt                          1


Org name                      # saved searches
--------------------------  ------------------
Sourcegraph                                  1

To only output users or orgs with multiple saved searches, add --multiple to the end of the command.

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.