mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-24 04:21:13 +00:00
Added dependency in README and commented out debug code
This commit is contained in:
parent
729adb7cc0
commit
eaa144c39a
|
@ -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:
|
||||||
|
|
||||||
|
|
10
twoot.py
10
twoot.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user