Compare commits
3 Commits
6884aefb1d
...
78db967922
Author | SHA1 | Date |
---|---|---|
Derek | 78db967922 | |
Derek | d1f1e829c3 | |
Derek | d6ab920737 |
|
@ -14,14 +14,14 @@ app.config.from_pyfile('settings.cfg')
|
|||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
@app.route('/itmeirl-bot')
|
||||
@app.route('/itmeirlbot-protect')
|
||||
def meirl_index():
|
||||
return render_template('itmeirl-bot/index.html')
|
||||
return render_template('itmeirlbot-protect/index.html')
|
||||
|
||||
@app.route('/itmeirl-bot/upload', methods=['POST'])
|
||||
@app.route('/itmeirlbot-protect/upload', methods=['POST'])
|
||||
def meirl_upload():
|
||||
if 'meme' in request.files:
|
||||
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirl')
|
||||
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirlbot-protect')
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
|
@ -39,7 +39,7 @@ def meirl_upload():
|
|||
watermark.close()
|
||||
meme.close()
|
||||
|
||||
url = url_for('meirl_show_reddit', file=filename[:-4])
|
||||
url = 'i.redd.it.' + request.host + url_for('meirl_show_reddit', file=filename[:-4])
|
||||
print(request.args)
|
||||
if request.args.get('noredirect') is not None:
|
||||
return url
|
||||
|
@ -48,11 +48,11 @@ def meirl_upload():
|
|||
|
||||
|
||||
# TODO: do these via nginx before you kill your server
|
||||
@app.route('/itmeirl-bot/files/<file>')
|
||||
@app.route('/itmeirlbot-protect/files/<file>')
|
||||
def meirl_show_reddit(file):
|
||||
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirl')
|
||||
return send_from_directory(directory, file + '.jpg')
|
||||
|
||||
@app.route('/itmeirl-bot/files/<file>.jpg')
|
||||
@app.route('/itmeirlbot-protect/files/<file>.jpg')
|
||||
def meirl_show_meirlbot(file):
|
||||
return app.send_static_file('bad.jpg')
|
||||
|
|
|
@ -28,6 +28,9 @@ body {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#upload_form {
|
||||
|
@ -35,11 +38,12 @@ body {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#upload_input {
|
||||
width: 100%;
|
||||
padding: 100px 0px;
|
||||
padding: 20px 0px;
|
||||
}
|
||||
#upload_button {
|
||||
width: 100%;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% block body %}
|
||||
<div id="mainwrapper">
|
||||
<h1>
|
||||
Excuse me sir, that meme appears to be <i>stolen</i>
|
||||
twitt normies get <i>hecked</i>
|
||||
</h1>
|
||||
<p>
|
||||
Protect your memes from the evil clutches of @ItMeIRL.
|
Loading…
Reference in New Issue