Skip to content

Instantly share code, notes, and snippets.

@ShaneDrury
Created October 19, 2015 09:38
Show Gist options
  • Save ShaneDrury/a4b79ed1c0bacdd1053c to your computer and use it in GitHub Desktop.
Save ShaneDrury/a4b79ed1c0bacdd1053c to your computer and use it in GitHub Desktop.
import giphypop
import requests
import requests.exceptions as exceptions
OLD_MARUS = [
"http://25.media.tumblr.com/00b01d310a564e619db5c62aa470d351/tumblr_mnks1dqE8X1qibxp4o4_500.jpg",
"http://24.media.tumblr.com/df63d7e6c2197d1c6abdfc1826808816/tumblr_mnkrz26btY1qibxp4o1_500.gif",
"http://25.media.tumblr.com/3502eb7665c844fd7c52bb1a387ed0c4/tumblr_mnj85ldSmp1qibxp4o6_500.jpg",
"http://31.media.tumblr.com/a7d2ae45e153905d30d5f1261d9993de/tumblr_mnj7pf02Dh1qibxp4o4_500.jpg",
"http://25.media.tumblr.com/f653df15f4c0b3bd1418324fe8be9ad5/tumblr_mnh5s7Qmi41qibxp4o2_500.jpg",
"http://25.media.tumblr.com/6857e8a6f47281610970871ec2ebd0ae/tumblr_mnh5ptlLHY1qibxp4o4_500.jpg",
"http://24.media.tumblr.com/6e92987fff0b84e1b0571554db29c26b/tumblr_mnh5n8xPJ71qibxp4o2_500.jpg",
"http://24.media.tumblr.com/4e19a54c31111d3b046029405c287806/tumblr_mnfvbciIBC1qibxp4o1_500.jpg",
"http://24.media.tumblr.com/211e162c07f1eccbdfeb600a398a6c22/tumblr_mlgn06ox0K1qibxp4o2_500.jpg",
"http://24.media.tumblr.com/c0a565e2f624b2688a857320aedf8859/tumblr_mlgmy0JE5Q1qibxp4o2_500.jpg",
"http://media.tumblr.com/9943c7f5474db2ad1fdd3efee3ac9697/tumblr_inline_mjcgj1SL1Z1qz4rgp.gif",
"http://25.media.tumblr.com/503f02cf9e2b72c60469d93d774e8194/tumblr_mjlpgtzITZ1r94e9jo1_500.gif",
"http://25.media.tumblr.com/8fe051f6a78537160f074c4b52e39cd6/tumblr_mjo7dgNmhu1rw1wnno1_500.gif",
"http://25.media.tumblr.com/9fd47edf1d2f19436dc707dae1daf213/tumblr_mlezhgnbnK1qibxp4o1_500.jpg",
"http://25.media.tumblr.com/bfab6c23f98d9c0ab7f496e5b1f31f42/tumblr_mj5y6fYPKd1qbhtrto1_r1_500.gif",
"http://25.media.tumblr.com/7bb748be4d63f437fcb8ef503588490e/tumblr_mj60zpkNFs1qewacoo1_500.jpg",
"http://25.media.tumblr.com/313fc83cab5ba20820c01b9713617670/tumblr_mivzamXIMY1qibxp4o1_500.gif",
"http://24.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo1_250.gif",
"http://25.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo2_250.gif",
"http://25.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo3_250.gif",
"http://24.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo4_250.gif",
"http://25.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo5_250.gif",
"http://24.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo6_250.gif",
"http://31.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo7_250.gif",
"http://24.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo8_250.gif",
"http://31.media.tumblr.com/tumblr_m5ds6gZcMd1r8m7ivo9_250.gif",
"http://25.media.tumblr.com/bfab6c23f98d9c0ab7f496e5b1f31f42/tumblr_mj5y6fYPKd1qbhtrto1_r1_500.gif",
"http://25.media.tumblr.com/b4b97d031cd31ac8343ce422b594795b/tumblr_mimymuDduo1qibxp4o1_500.jpg",
"http://24.media.tumblr.com/35236e572e0fac93e6d476a70ba75c5a/tumblr_mirse9Lmr61qio7gwo3_500.jpg",
"http://24.media.tumblr.com/d08b38d72e1c827fb8db7ea98d6d25cd/tumblr_mimymuDduo1qibxp4o4_500.jpg",
"http://25.media.tumblr.com/d149c538af6ad6338c33a0450934b078/tumblr_mimyi9XAlR1qibxp4o1_500.jpg",
"http://25.media.tumblr.com/70fa286d9e9418306ffa959f33e4f78e/tumblr_mimyi9XAlR1qibxp4o2_500.jpg",
"http://31.media.tumblr.com/178e12aa1f3da8d76cf8f1d128d9362b/tumblr_mimyi9XAlR1qibxp4o3_500.jpg",
"http://25.media.tumblr.com/b126ac87b2fe206333d052333c57fa11/tumblr_mimyi9XAlR1qibxp4o4_500.jpg",
"http://24.media.tumblr.com/4368a34dc1c16fa982ed2c6e3ec5a0db/tumblr_mi483vMF9g1qibxp4o1_500.jpg",
"http://31.media.tumblr.com/22de402c0e086e6d7b58e99ecde82279/tumblr_mhns25kW1A1qibxp4o1_500.jpg",
"http://24.media.tumblr.com/c6cf21b6fb327b3a2ef9c30bf7f198e0/tumblr_mhns1e84If1qibxp4o1_500.jpg",
"http://25.media.tumblr.com/dc391af0c798c7875da390ae2f77d552/tumblr_mhns1e84If1qibxp4o2_500.jpg",
"http://24.media.tumblr.com/8bcd9de2f1771e034a915d373887f4a5/tumblr_mhg8xiG0rT1qibxp4o1_500.jpg",
"http://31.media.tumblr.com/810c02418b2b0747647cf0236cda09c8/tumblr_mhf2asEdLi1qibxp4o1_400.gif",
"http://31.media.tumblr.com/ebd87ccb75c72e5b30031af4dc915fac/tumblr_mhea6qUnuN1qibxp4o1_500.jpg",
"http://25.media.tumblr.com/fb0bddfdccab03a20c4906ec341ebf7e/tumblr_mhamf6f9oV1qibxp4o2_500.jpg",
"http://25.media.tumblr.com/bf57d488c817e227da8cf8050d0a8c76/tumblr_mhamb4910G1qibxp4o4_500.jpg",
"http://31.media.tumblr.com/f33a023a533c8d833d577c9c72cc4721/tumblr_mfjperPu3V1qibxp4o3_500.jpg",
"http://25.media.tumblr.com/53cb1e62f33ec29f370036c57889c3f4/tumblr_mfjpc1nZK81qibxp4o1_500.jpg",
"http://24.media.tumblr.com/55df95e311d07b37c8608d2dd71f5ff8/tumblr_mfjpc1nZK81qibxp4o2_500.jpg",
"http://24.media.tumblr.com/0d59aaf7553de4125943fd3f70a32ca9/tumblr_mfjpatFxPT1qibxp4o3_500.jpg",
"http://24.media.tumblr.com/5fa0e48895f0147154784bf85a4e8841/tumblr_mfjpatFxPT1qibxp4o5_500.jpg",
"http://24.media.tumblr.com/9f3ea02ac09b2aeb23003384328e029b/tumblr_mfjp96bhWC1qibxp4o4_500.jpg",
"http://25.media.tumblr.com/7f4cab331439fb664e16552ceda2f569/tumblr_mfjp96bhWC1qibxp4o3_500.jpg",
"http://24.media.tumblr.com/0296332c24d6cb0ea9eba16ab4a3e968/tumblr_mf31txTTDk1qibxp4o2_500.jpg",
"http://24.media.tumblr.com/57a42acefd5b4180c31bee957980305e/tumblr_mf31swhVVl1qibxp4o2_500.jpg",
"http://25.media.tumblr.com/a993a440ff914b5049e202b6248cc5f5/tumblr_mf31quZtle1qibxp4o1_500.jpg",
"http://25.media.tumblr.com/779418744ed55853d6c10fcd80627acc/tumblr_mf31q0RCZA1qibxp4o1_500.jpg",
"http://31.media.tumblr.com/b1b6a3de2f44c0b78027e6d41b5898d1/tumblr_mf31onfvEe1qibxp4o2_500.jpg",
"http://25.media.tumblr.com/tumblr_mekyr6DS711qibxp4o1_500.jpg",
"http://25.media.tumblr.com/tumblr_mekycmjjAH1qibxp4o2_500.jpg",
"http://24.media.tumblr.com/tumblr_mekycmjjAH1qibxp4o4_500.jpg",
"http://31.media.tumblr.com/tumblr_mekycmjjAH1qibxp4o3_500.jpg",
"http://25.media.tumblr.com/tumblr_mdvfwhpYvD1qibxp4o1_500.jpg",
"http://24.media.tumblr.com/tumblr_mdvfsuCG9I1qibxp4o1_500.jpg",
]
def maru_is_alive(url):
response = requests.get(url)
try:
response.raise_for_status()
except exceptions.HTTPError:
return False
return True
def format_line(line):
return ' "{}",'.format(line)
def main():
alive_marus = [maru for maru in OLD_MARUS if maru_is_alive(maru)]
g = giphypop.Giphy()
giphy_urls = [result.media_url for result in g.search_list('#maru #cat')]
all_results = alive_marus + giphy_urls
for result in all_results:
print(format_line(result))
print("# Marus: {}".format(len(all_results)))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment