Skip to content

Instantly share code, notes, and snippets.

@moshekaplan
Created January 8, 2014 17:21
Show Gist options
  • Select an option

  • Save moshekaplan/8320605 to your computer and use it in GitHub Desktop.

Select an option

Save moshekaplan/8320605 to your computer and use it in GitHub Desktop.
Check if an IMGUR ID is 'nsfw'
import pyimgur
CLIENT_ID = ""
im = pyimgur.Imgur(CLIENT_ID)
blacklist = ['nsfw']
def is_fishy_imgur(id):
# Takes an Imgur ID and returns True if it is fishy
image = im.get_image(id)
image_data = []
if image.title:
image_data += [image.title]
if image.description:
image_data += [image.description]
if image.section:
image_data += [image.section]
for entry in blacklist:
for data in image_data:
if entry in data:
return True
return False
print is_fishy_imgur('6PX8AQN')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment