static | ||
.gitignore | ||
config.py.example | ||
LICENSE | ||
models.py | ||
README.md | ||
requirements.txt | ||
server.py |
Weboob modules CI
A small script exposin an API to store the status of Weboob modules and track it over time.
A web visualisation is available, built on top of this API.
Installation
- Git clone the repo.
pip install -r requirements.txt
- Copy
config.py.example
toconfig.py
and edit according to your needs.
Then, you are ready to run ./server.py
.
API
The server exposes an API on the /api
route.
GET /api/v1/modules
Returns a JSON blob of the data shown on the index webpage (latest build for each module).
curl http://SERVER/api/v1/modules
{
"data": [
{
"origin": "toto",
"status": "good",
"module": "adecco",
"datetime": "2016-11-30T12:05:03+00:00"
},
{
"origin": "toto",
"status": "bad",
"module": "freemobile",
"datetime": "2016-11-30T12:05:03+00:00"
},
...
]
}
GET /api/v1/modules/<module>/<datetime_start>/<datetime_end>
Returns a JSON blob of the builds for the specified module in the specified datetime range.
curl http://SERVER/api/v1/modules/adecco/2016-11-20T05:00:00.000Z/2016-12-02T04:00:00.000Z
{
"data": [
{
"origin": "toto",
"status": "good",
"module": "adecco",
"datetime": "2016-11-30T12:05:03+00:00"
},
{
"origin": "toto",
"status": "good",
"module": "adecco",
"datetime": "2016-11-30T12:05:03+00:00"
},
...
]
}
POST /api/v1/modules
curl -X POST -H "Content-Type: application/json" --data "JSON_DATA" http://SERVER/api/v1/modules
where JSON_DATA
is a JSON object containing at least the following keys:
- modules
- A JSON object having two keys: bad and good. Each value must be an array of module names.
- origin
- A string identifying where the data comes from.
and SERVER
is your server URL.
A typical JSON_DATA
is:
{
"origin": "toto",
"modules": {
"bad": [
"presseurop"
],
"good": [
"mangareader",
"edf",
"mangago",
"adecco",
"indeed"
]
}
}
Note: The Content-Type
is important and must be sent correctly. You will
get a 400 HTTP error if the JSON query is not valid (either bad Content-Type
or invalid JSON object).
License
All the code in this repo is under MIT license.
Credits
For the backend:
For the frontend: