Code Monkey home page Code Monkey logo

track-stargazers's Introduction

Track-Your-Stargazers

Have fun tracking your project's stargazers.

Inspiration

I saw this post at Codementor by Ionică Bizău which lead me to his project, so I decided to create something cool of my own.

What have I used?

Python

Javascript

See the World Map showing your project's stargazers in just 2 Steps.

  • Step 1

    Run the following command replacing the url with your own.

    python3 main.py https://github.com/kivy/plyer 3 0 1
    

    Arguments:

    • url: URL of the project/ Repo who's stargazers you want to track. e.g: http://github.com/kivy/plyer

    • number_of_threads (+ve integer): Number of python threads you want to run. It will divide the entire users list into smaller lists equal to number_of_threads and create a new thread for each.

      python3 main.py http://github.com/kivy/plyer 3
      

      example:

      l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      print (chunk_stargazers(l, 3))
      print (chunk_stargazers(l, 2))
      

      output

      [[1, 2, 3], [4, 5, 6], [7, 8, 9, 10]]
      [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]
      

    While parallel CPU computation is not possible, parallel IO operations are possible using threads in Python. This is because performing IO operations releases the GIL. In network IO, most of the time is spent waiting for the response from the URL, so this is a use case where using threads improves performance, so why not use them? :D

    • use_api (Binary): Choose whether you want to use the GitHub's user API to get the user data or use the scraper. To use the api enter 1 else 0
    python3 main.py http://github.com/kivy/plyer 3 0
    
    • read_from_stargazers_json (Binary): If there is a stargazers.json file aleady present with list of users you want to plot then you can skip scraping of users from the project's stargazer's page e.g http://github.com/kivy/plyer/stargazers?page=2 by setting the value of this argument to 1.
    python3 main.py http://github.com/kivy/plyer 3 0 1
    
  • Step 2

    python3 merge_data.py 2

    Arguments:

    • number_of_files: Let this number be equal to number_of_threads since each thread create a new json file.
    jsons/
        data_0.json
        data_1.json
    

    so the command should be

    python3 merge_data.py 2

    This command will merge all the json files and generate a new stargazers.js in the data/ directory. stargazers.js file will later be used as data source when plotting the map.

Open the Browser with index.html and get surprised.

Want to contribute or need to see some improvements?

I would love that, please create an issue or send a PR.

track-stargazers's People

Contributors

kiok46 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

Watchers

 avatar  avatar  avatar  avatar

track-stargazers's Issues

Some things didn't work, but I fixed them

Hello and thank your for your project!

I work as a developer on the AutoML open source framework FEDOT. We wanted to create a map of our stargazers, so I used your repo. The last commit was 6 years ago, so many things changed, that's why your source code didn't work. I made some fixes, renewed parser, and proposed some other solutions to this project. Everything works well now.

I've made a PR, so you can review and approve my changes.

Looking forward for your response,
Andrey

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.