Skip to content

Instantly share code, notes, and snippets.

@Luzifer
Last active January 16, 2017 09:57
Show Gist options
  • Save Luzifer/e687851ea2a2888fc5e002736e946137 to your computer and use it in GitHub Desktop.
Save Luzifer/e687851ea2a2888fc5e002736e946137 to your computer and use it in GitHub Desktop.
This is a small Alfred workflow generating thumbs-up-Markdown to use in Pull-Requests.

What's this?

This is a small Alfred workflow generating thumbs-up-Markdown to use in Pull-Requests. Useless? Maybe... I don't care... I use those images instead of a simple text "LGTM" in Pull-Requests I'm reviewing and I use a workflow for this to randomize them.

How to get image X into this?

Below is the json file containing the used images. Tell me about the image or create a Pull-Request (if this is somehow possible for a Gist).

import sys, requests, time
from random import shuffle
timestamp = int(time.time())
url = 'https://gist.githubusercontent.com/Luzifer/e687851ea2a2888fc5e002736e946137/raw/thumbs.json?v={}'.format(timestamp)
data = requests.get(url).json()
images = data['gifs']
shuffle(images)
sys.stdout.write("![LGTM]({})".format(images[0]))
{
"gifs": [
"http://31.media.tumblr.com/cdf4b4952bdcaa09c29b2ba25794df87/tumblr_mnkbkr2xci1s4khlyo1_500.gif",
"http://cdn4.teen.com/wp-content/uploads/2013/04/shay-mitchell-birthday-april-10-2013-gifs-the-twelfth-of-june.gif",
"http://cdn.atl.clicrbs.com.br/wp-content/uploads/sites/29/2014/12/Thumbs-UP-woman-gif1.gif",
"http://data.whicdn.com/images/39994802/original.gif",
"http://d.gr-assets.com/hostedimages/1380222758ra/506918.gif",
"http://giririsss.com/Pictures/gifs/FannyThumbs.gif",
"http://likegif.com/wp-content/uploads/2013/12/dean-winchesterjensen-ackles.gif",
"https://az616578.vo.msecnd.net/files/2016/03/05/635927492067641900-1604829580_zooey-deschanel-thumbs-up.gif",
"https://media.giphy.com/media/8KFry72e9jrGM/giphy.gif",
"https://media.giphy.com/media/aysMUD6VggKEU/giphy.gif",
"https://media.giphy.com/media/G6wEFwAFxN9Pq/giphy.gif",
"https://media.giphy.com/media/ghXiIdetGpbzy/giphy.gif",
"https://media.giphy.com/media/q5J2HfnH8mCvS/giphy.gif",
"https://media.giphy.com/media/tPzR28ltwUR9u/giphy.gif",
"https://media.giphy.com/media/Uh52H832sAjra/giphy.gif",
"https://media.giphy.com/media/xyeG0EKV0pFnO/giphy.gif",
"https://media.giphy.com/media/yTmRjfASIYMYo/giphy.gif",
"https://uproxx.files.wordpress.com/2012/09/karen-thumbs-up.gif",
"http://www.snarksquad.com/wp-content/uploads/2014/11/thumbs-up.gif"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment