From e7145c4d8fc652b2f70dd8b554367fb7cdf8c666 Mon Sep 17 00:00:00 2001 From: Lynne Megido Date: Wed, 8 May 2019 09:31:46 +0000 Subject: [PATCH] delete image after upload --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100755 => 100644 main.py diff --git a/main.py b/main.py old mode 100755 new mode 100644 index 98742eb..a084a37 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ from mastodon import Mastodon import twitter import requests -import sqlite3, json, re, random +import sqlite3, json, re, random, os cfg = { "cw":None, @@ -137,4 +137,5 @@ open(filename, 'wb').write(requests.get(image).content) # post! media = client.media_post(filename, description="Image downloaded from Twitter account {}".format(acct)) client.status_post("Source: https://twitter.com/{}/status/{}".format(acct, chosen_tweet[0]), media_ids=media) +os.remove(filename)