Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the TUMBLR_HOST environment variable to set the popup notification that shows after each photo taken #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export DROPBOX_SECRET=https://www.dropbox.com/developers
export TUMBLR_KEY=youllgetthisfromtuble
export TUMBLR_SECRET=https://www.tumblr.com/docs/en/api/v2
export TUMBLR_HOSTNAME=whereeveryouwanttohost.tumblr.com
export MONGOLAB_URI=youllgetthisfromherokuaddonsifyouwantto
export MONGOHQ_URL=youllgetthisfromherokuaddonsifyouwantto

echo success!
echo success!!
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Want to see some GIFs generated by JIFBOX? Check out Sunlight Foundation's [Sunf

## Deploy

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/sunlightlabs/jifbox)
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/polisurgist/jifbox)

Click the button above to deploy on a new [Heroku](https://heroku.com) instance. You will be prompted for [configuration values](#environment-variables).

Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
}
},
"addons": [
"mongohq:sandbox"
"mongohq:ssd_1g_elastic"
]
}
2 changes: 1 addition & 1 deletion templates/jifbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<video id="vdo"></video>
<div class="finished-jif is-hidden">
<div class="finished-msg">
<span>Excellent work! Go grab this gif from <a href="http://sunfrightgifs.tumblr.com">sunfrightgifs.tumblr.com</a></span>
<span>Excellent work! Go grab this gif from <a href="http://{{ tumblr_host }}">{{ tumblr_host }}</a></span>
</div>
<img src="" id="jif">
</div>
Expand Down
7 changes: 5 additions & 2 deletions web.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

SECRET_KEY = os.environ.get('SECRET_KEY')


DEFAULT_SETTINGS = {
'frame_delay': 255,
'frames': 10,
Expand All @@ -33,7 +34,7 @@
# MongoDB configuration
#

mongo_url = os.environ.get('MONGOLAB_URI')
mongo_url = os.environ.get('MONGOHQ_URL')
mongo_conn = MongoClient(mongo_url)

mongo_params = urlparse(mongo_url)
Expand All @@ -43,6 +44,7 @@
if mongo_params.username and mongo_params.password:
mongo.authenticate(mongo_params.username, mongo_params.password)

tumblr_host = os.environ.get('TUMBLR_HOSTNAME')

#
# services
Expand Down Expand Up @@ -309,7 +311,8 @@ def logout():
@app.route('/')
@login_maybe_required
def index():
return render_template('jifbox.html')
context = {'tumblr_host': tumblr_host}
return render_template('jifbox.html', **context)


@app.route('/giffed', methods=['POST'])
Expand Down