Skip to content

Instantly share code, notes, and snippets.

@schinken
Created March 22, 2013 13:38
Show Gist options
  • Save schinken/5221331 to your computer and use it in GitHub Desktop.
Save schinken/5221331 to your computer and use it in GitHub Desktop.
import requests
from flask import Flask
app = Flask(__name__)
@app.route("/")
def toggle():
url = 'https://webrelais.bckspc.de/relais/3'
if requests.get(url).json()['response']:
requests.delete(url)
else:
requests.post(url)
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment