Exemplo n.º 1
0
client_secret = config.get('credentials', 'client_secret')
client = ImgurClient(client_id, client_secret)

# oops bad variables
day = 999
item_num = 0
pagenum = 0
errors = 0
post_total = 0
image_total = 0
links = []

while day > 5:
    # get all submissions from an account
    user_posts = client.get_account_submissions(config.get(
        'users', 'target_user'),
                                                page=pagenum)

    for u_post in user_posts:
        try:
            images = client.get_album_images(u_post.id)

            # check if 'cropped is in post title'
            if 'cropped' in u_post.title.lower(
            ) or 'tasteful' in u_post.title.lower():

                # hacky bs to pull a number from the title don't think about it too much
                try:
                    day = int(''.join(filter(str.isdigit, u_post.title)))
                except ValueError:
                    day -= 1