62 lines
1.6 KiB
Markdown
62 lines
1.6 KiB
Markdown
# Pythagoras
|
|
|
|
Local-run server which acts as a proxy between the moderation server, presentation client and subtitle scripts. This is a single-purpose ugly implementation with its sole purpose being the Richard Stallman lecture at TUL.
|
|
|
|
## Installation
|
|
|
|
Clone the repository:
|
|
|
|
`git clone git@gordon.zumepro.cz:zumepro/pythagoras.git`
|
|
|
|
Install the dependencies:
|
|
|
|
`cd pythagoras`
|
|
|
|
`python -m venv venv`
|
|
|
|
`source venv/bin/activate`
|
|
|
|
`pip install -r requirements.txt`
|
|
|
|
## Running the app
|
|
|
|
Simply run the main Python file to start the server:
|
|
|
|
`python main.py`
|
|
|
|
## Usage
|
|
|
|
To push new subtitles onto the server, use the `/subtitles` endpoint, for example like this:
|
|
|
|
`
|
|
curl -X POST http://localhost:8000/subtitles -H "Content-Type: text/plain" -d 'I love pushing subtitles to servers!'
|
|
`
|
|
|
|
To control the server using commands, use the `/control` endpoint, for example like this:
|
|
|
|
- Poll the peehaitchpea server for the latest message to display:
|
|
|
|
`
|
|
curl -X POST http://localhost:8000/control -H "Content-Type: application/json" -d '{"command": "getselectedmessage"}'
|
|
`
|
|
|
|
- Change the state of auto-polling:
|
|
|
|
`
|
|
curl -X POST http://localhost:8000/control -H "Content-Type: application/json" -d '{"command": "setautopolling", "state": false}'
|
|
`
|
|
|
|
`
|
|
curl -X POST http://localhost:8000/control -H "Content-Type: application/json" -d '{"command": "setautopolling", "state": true}'
|
|
`
|
|
|
|
- Set the polling rate to a value (in seconds):
|
|
|
|
`
|
|
curl -X POST http://localhost:8000/control -H "Content-Type: application/json" -d '{"command": "autopollingrate", "rate": 10}'
|
|
`
|
|
|
|
## TODO
|
|
|
|
- Create a command for playing a video (the TED talk RMS likes to play at the beginning of his lecture)
|