Added dependency in README and commented out debug code

This commit is contained in:
JC Francois 2019-08-01 17:17:47 +02:00
parent 729adb7cc0
commit eaa144c39a
2 changed files with 11 additions and 8 deletions

View File

@ -42,11 +42,14 @@ Default min delay is 0 minutes.
# installation # 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 and process the tweets posted in the last 5 days but at least 15 minutes
ago: ago:

View File

@ -146,9 +146,9 @@ def main(argv):
response = requests.get('https://twitter.com/' + twit_account, headers=headers) response = requests.get('https://twitter.com/' + twit_account, headers=headers)
# DEBUG: Save page to file # DEBUG: Save page to file
of = open('twitter.html', 'w') # of = open('twitter.html', 'w')
of.write(response.text) # of.write(response.text)
of.close() # of.close()
# Verify that download worked # Verify that download worked
if response.status_code != 200: if response.status_code != 200:
@ -223,8 +223,8 @@ def main(argv):
tweets.append(tweet) tweets.append(tweet)
# DEBUG: Print extracted tweets # DEBUG: Print extracted tweets
for t in tweets: # for t in tweets:
print(t) # print(t)
# ********************************************************** # **********************************************************
# Iterate tweets. Check if the tweet has already been posted # Iterate tweets. Check if the tweet has already been posted