Skip to content

Instantly share code, notes, and snippets.

@t94j0
Created December 1, 2016 04:01
Show Gist options
  • Save t94j0/f1ff7ffabee2dc31e7ec2ac5657d4289 to your computer and use it in GitHub Desktop.
Save t94j0/f1ff7ffabee2dc31e7ec2ac5657d4289 to your computer and use it in GitHub Desktop.
Remember to always be on top of your memes
function meme
curl -s https://www.reddit.com/r/me_irl.json > /tmp/me_irl.json
open (python3 -c "
import json
import random
imgurs = []
with open('/tmp/me_irl.json') as f:
parsed = json.loads(f.read())
for images in parsed['data']['children']:
if images['data']['domain'] == 'imgur.com':
imgurs.append(images['data']['url'])
print(imgurs[random.randint(0,len(imgurs))])
" > /dev/null) > /dev/null
echo "I have created a meme"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment