Created
June 12, 2015 18:19
-
-
Save mikespencer/9b2780a28cb8790a9488 to your computer and use it in GitHub Desktop.
yobeer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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