From eaa144c39a5ae538d8de59b02f6c4921d2c17ee1 Mon Sep 17 00:00:00 2001 From: JC Francois Date: Thu, 1 Aug 2019 17:17:47 +0200 Subject: [PATCH] Added dependency in README and commented out debug code --- README.md | 9 ++++++--- twoot.py | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index efdd8e9..1bef04a 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,14 @@ Default min delay is 0 minutes. # installation -Create a folder and copy twoot.py in it. +Make sure python3 is installed. -Add command line to crontab. +Twoot depends on beautifulsoup4 python module: `sudo pip install beautifulsoup4` -For example, to run every 15 minutes starting at minute 1 of every hour +In your user folder, execute `git clone https://gitlab.com/jeancf/twoot.git` +to clone repo with twoot.py script. + +Add command line to crontab. For example, to run every 15 minutes starting at minute 1 of every hour and process the tweets posted in the last 5 days but at least 15 minutes ago: diff --git a/twoot.py b/twoot.py index 8896c80..2a6da44 100755 --- a/twoot.py +++ b/twoot.py @@ -146,9 +146,9 @@ def main(argv): response = requests.get('https://twitter.com/' + twit_account, headers=headers) # DEBUG: Save page to file - of = open('twitter.html', 'w') - of.write(response.text) - of.close() + # of = open('twitter.html', 'w') + # of.write(response.text) + # of.close() # Verify that download worked if response.status_code != 200: @@ -223,8 +223,8 @@ def main(argv): tweets.append(tweet) # DEBUG: Print extracted tweets - for t in tweets: - print(t) + # for t in tweets: + # print(t) # ********************************************************** # Iterate tweets. Check if the tweet has already been posted