Skip to content

Simple server implemented in Python language which lists the github repositories, their number of stars and sum of stars for the selected username.

License

Notifications You must be signed in to change notification settings

sniochup/repositories-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Repositories list

Simple server implemented in Python language which lists the github repositories, their number of stars and sum of stars for the selected username.

Installation

Firstly, you need to install the libraries if you don't have them on your computer yet.

pip install requests

Then go to the directory with server.py file. To start the server on the default localhost 9000 port in command line type:

python server.py

To choose the number of the localhost port type:

      python server.py <PORT_NUMBER>
like: python server.py 8080

Now your server is working until you will call keyboard interruption pressing Ctrl+C combination.

Usage

Server handle three types of request which returns the data using the HTTP protocol.

HEAD

Returns only headers with response code 200. To send the HEAD request type in command line:

       curl -X HEAD -I localhost:<PORT>
like:  curl -X HEAD -I localhost:9000

       curl -X HEAD -I 127.0.0.1:<PORT>
like   curl -X HEAD -I 127.0.0.1:9000

GET

Returns an information as a json file with response code 200. The request should be in the following format with username in a path. To send the GET request type in command line:

      curl -X GET localhost:9000/<username>
like: curl -X GET localhost:9000/allegro

      curl -X GET 127.0.0.1:9000/<username>
like: curl -X GET 127.0.0.1:9000/allegro

POST

Returns an information as a json file with response code 200. The request should be in the following format with username in a quotes after -d mark. To send the POST request type in command line:

      curl -X POST -d "<username>" localhost:<PORT>
like: curl -X POST -d "allegro" localhost:9000

      curl -X POST -d "<username>" 127.0.0.1:<PORT>
like: curl -X POST -d "allegro" 127.0.0.1:9000

Possible upgrades

  • using authentication tokens to increase github api request limit
  • getting more information about the repositories, such as last update or language

License

MIT

About

Simple server implemented in Python language which lists the github repositories, their number of stars and sum of stars for the selected username.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages