diff --git a/.gitignore b/.gitignore index e9b8774..0b4a4cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *~ .vscode .env +bot.session diff --git a/README.md b/README.md index b683d57..1b9017f 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,18 @@ The production environment will eventually be hosted at [save.c0de.link](https:/ This project uses [Pipenv](https://pipenv.readthedocs.io/en/latest/) to manage the dependencies, so install that first after cloning this repository. * Install dependencies - `pipenv install` +* Create a Telegram bot (see Creating a Telegram Bot) * Enter the environment - `pipenv shell` -* Start the server - `python server.py` +* Start the server - `bash run.sh` The server will be running on `http://localhost:8080/` +### Creating a Telegram bot + +1. Login to [my.telegram.org/apps](https://my.telegram.org/apps) and create a Web App - You will need the `api_id` and `api_hash` +1. Message the [BotFather](https://t.me/BotFather) to get an `api_token` +1. Copy `sample.env` to `.env` and fill in the details from the previous steps + ## Available Requests Now that you have a running server, you can issue requests via a web browser, curl, wget, etc to the following endpoints: diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..5534919 --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Copyright 2020 - David Todd (c0de@c0defox.es) +# Licensed under the MIT License (https://opensource.org/licenses/MIT) +# Part of the Simple Bookmark Service + +source .env +python server.py diff --git a/sample.env b/sample.env new file mode 100644 index 0000000..8c440dd --- /dev/null +++ b/sample.env @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright 2020 - David Todd (c0de@c0defox.es) +# Licensed under the MIT License (https://opensource.org/licenses/MIT) +# Part of the Simple Bookmark Service + +export telethon_api_id= +export telethon_api_hash= +export telethon_token=