mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-27 22:11:11 +00:00
Added comments and TODOs
This commit is contained in:
parent
b768561662
commit
909183eb0a
4
twoot.py
4
twoot.py
|
@ -177,6 +177,7 @@ def contains_class(body_classes, some_class):
|
||||||
def main(argv):
|
def main(argv):
|
||||||
|
|
||||||
# Build parser for command line arguments
|
# Build parser for command line arguments
|
||||||
|
# TODO Add option for ingestion of video content
|
||||||
parser = argparse.ArgumentParser(description='toot tweets.')
|
parser = argparse.ArgumentParser(description='toot tweets.')
|
||||||
parser.add_argument('-t', metavar='<twitter account>', action='store', required=True)
|
parser.add_argument('-t', metavar='<twitter account>', action='store', required=True)
|
||||||
parser.add_argument('-i', metavar='<mastodon instance>', action='store', required=True)
|
parser.add_argument('-i', metavar='<mastodon instance>', action='store', required=True)
|
||||||
|
@ -450,6 +451,7 @@ def main(argv):
|
||||||
# Upload tweets
|
# Upload tweets
|
||||||
for tweet in reversed(tweets):
|
for tweet in reversed(tweets):
|
||||||
# Check in database if tweet has already been posted
|
# Check in database if tweet has already been posted
|
||||||
|
# FIXME Move tests to the front of the process to avoid the unnecessary processing of already ingested tweets
|
||||||
db.execute('''SELECT * FROM toots WHERE twitter_account = ? AND mastodon_instance = ? AND
|
db.execute('''SELECT * FROM toots WHERE twitter_account = ? AND mastodon_instance = ? AND
|
||||||
mastodon_account = ? AND tweet_id = ?''',
|
mastodon_account = ? AND tweet_id = ?''',
|
||||||
(twit_account, mast_instance, mast_account, tweet['tweet_id']))
|
(twit_account, mast_instance, mast_account, tweet['tweet_id']))
|
||||||
|
@ -475,7 +477,7 @@ def main(argv):
|
||||||
# Download picture
|
# Download picture
|
||||||
try:
|
try:
|
||||||
media = requests.get(photo)
|
media = requests.get(photo)
|
||||||
except:
|
except: # Picture cannot be downloaded for any reason
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Upload picture to Mastodon instance
|
# Upload picture to Mastodon instance
|
||||||
|
|
Loading…
Reference in New Issue
Block a user