repo-checker

Sequence which get info for repos on various platforms and send it to topic

Description

  • Name: @scramjet/repo-checker
  • Version: 1.0.0
  • Language: typescript
  • Author: Piotr
  • Tags: api,statistics,info,https,topic

Description

This sequence supports retriveing data from those platforms:

  • Docker Hub -Pull Count, Stars
  • GitHub -Weekly Stars, Weekly Views
  • PyPi -Weekly Downloads
  • Npm - Weekly Downloads

Prerequisites

❗ Remember to setup transform-hub locally or use the platform's environment for the sequence deployment.

As this apps is using github API, the key is required to use it. For informations how to get one please refer to creating-personal-access-token

To get this app running you need to provide informations in a data.json file to match repositories you want to check

{ "gitHubRepos": [ { "owner":"owner", "repo":"repository-name" } ], "dockerHubRepos": ["user/repo-name"], "pyPiRepos":["repo-name"], "npmRepos":["repo-name"] }

Example data for testing :

{ "gitHubRepos": [ { "owner":"scramjetorg", "repo":"transform-hub" } ], "dockerHubRepos": ["scramjetorg/pre-runner"], "pyPiRepos":["scramjet-api-client"], "npmRepos":["scramjet"] }

❗ ❗ Currently all fields in json file are necessary to run this code. Not providing one or providing wrong value will result in no response.

Running

Open the terminal and run the following commands:

# go to 'repo-checker' directory cd typescript/repo-checker # install dependencies npm install # transpile TS->JS to dist/ npm run build # deploy the Sequence withh a following arguments where first one is a time interval in ms which determines how often to check for data and second is github api key si seq deploy dist --args '[10000,"YOUR-GITHUB-API-KEY-HERE"]'

Getting results

To get results run the following code in terminal:

# access data stored in topic which has been generated by sequence si topic get repo-data

This should result in a output with following style:

"{\"repoName\":\"scramjetorg/pre-runner\",\"repoType\":\"docker hub\",\"dataType\":\"total pulls\",\"number\":3321}"