From 4193f0eb13323378e6bcf9d5954248ad70d9e5b5 Mon Sep 17 00:00:00 2001 From: Hellowlol Date: Wed, 27 Jan 2016 12:48:39 +0100 Subject: [PATCH] Created Example script python (markdown) --- Example-script-python.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Example-script-python.md diff --git a/Example-script-python.md b/Example-script-python.md new file mode 100644 index 0000000..064a100 --- /dev/null +++ b/Example-script-python.md @@ -0,0 +1,16 @@ +``` +import sys +import requests + +# sys.argv[1] is the first argument +# sys.argv[2] is the second argument etc + +USERID = '' +KEY= '' +TIMEOUT= 10 +URL = 'https://api.telegram.org/bot$KEY/sendMessage' +TEXT = 'Crap, your server is transcoding something: ! Go check on it, noob!' +url = URL + chat_id=%s&disable_web_page_preview=1&text=%s % (KEY, TEXT) +if sys.argv[1] != 'Direct Play' and sys.arv[1] != 'Copy': + requests.get(url, timeout=timeout) +```