Skip to content

Instantly share code, notes, and snippets.

@mikespencer
Created June 12, 2015 18:19
Show Gist options
  • Save mikespencer/9b2780a28cb8790a9488 to your computer and use it in GitHub Desktop.
Save mikespencer/9b2780a28cb8790a9488 to your computer and use it in GitHub Desktop.
yobeer
import requests
from flask import Flask, request
app = Flask(__name__)
@app.route("/")
def respond_to_yo():
api_token = 'da35e2da-128c-47d7-9360-fb73b9eb386a'
username = request.args.get('username', '')
if username:
link = 'http://mikespencer.github.io/showtext/?text=%s+wants+a+beer!&img=/img/beer.png&backgroundColor=purple&textShadow=0+0+3px+black&fontSize=32px' % (username)
requests.post("https://api.justyo.co/yoall/", data={'api_token': api_token, 'link': link})
return "Yo!"
else:
return "No username"
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment