#!/usr/bin/python3

import tweepy
import random
import os

from secrets import *

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
twitter = tweepy.API(auth)

photo_file = os.path.join("polaroids", os.listdir("polaroids")[0])
comment = random.choice([
        "Hmm ...",
        "Remember this party?",
        "Oh dear.",
        "Huh.",
        "Uh ...",
        "I totally forgot about this.",
        "Oh geeze.",
        "This one's going in my scrapbook.",
        "...",
        "Oh wow, remember this?",
        "Whose house even was this?",
        "I don't remember this at all.",
        "Er ...",
        "Those were the days.",
        "I miss that crew."
    ])

tweet = twitter.update_with_media(photo_file, comment)
os.remove(photo_file)

#!/usr/bin/python3

"""
Copyright (c) 2017 Finn Ellis.
Free to use and modify under the terms of the MIT license.
See included LICENSE file for details.
"""

import tweepy
import random
import os

from secrets import *

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
twitter = tweepy.API(auth)

photo_file = os.path.join("polaroids", os.listdir("polaroids")[0])
comment = random.choice([
        "Hmm ...",
        "Remember this party?",
        "Oh dear.",
        "Huh.",
        "Uh ...",
        "I totally forgot about this.",
        "Oh geeze.",
        "This one's going in my scrapbook.",
        "...",
        "Oh wow, remember this?",
        "Whose house even was this?",
        "I don't remember this at all.",
        "Er ...",
        "Those were the days.",
        "I miss that crew."
    ])

tweet = twitter.update_with_media(photo_file, comment)
os.remove(photo_file)

Add copyright and license information.