def photo_response(data): if "text" in data and "photo" in data["text"]: text = data["user"]["screen_name"] in_reply_to_status_id = data["id_str"] photo = t.take_photo() media_id = t.upload(photo) t.tweet(text=text, media_id=media_id, in_reply_to_status_id=in_reply_to_status_id)
def tweet_photo(): photo = t.take_photo() media_id = t.upload(photo) text = "" text += datetime.datetime.now().strftime("%c") t.tweet(text=text, media_id=media_id)