Browse Source

move split_tweet to vendor direcotry

master
hfte 2 years ago
parent
commit
9ee2b410e5
  1. 3
      .gitignore
  2. 7
      mastaface.py
  3. 0
      vendor/__init__.py
  4. 0
      vendor/split_tweet.py

3
.gitignore vendored

@ -1,3 +1,4 @@
config.json
database.pkl
tmp.jpg
tmp.jpg
vendor/__pycache__

7
mastaface.py

@ -20,7 +20,7 @@ import json
import pickle
from os import path
import subprocess
from split_tweet import split_tweet
from vendor import split_tweet
database_filename = 'database.pkl'
mastodon_character_limit = 500
@ -54,15 +54,16 @@ posts_list = list(posts)
post = posts_list[0]
# Split-up facebook post into tweets according to character limit
toots_text = split_tweet(post['post_text'], mastodon_character_limit - 30)
toots_text = split_tweet.split_tweet(post['post_text'], mastodon_character_limit - 30)
# Check if there is a new post, or the last one has been edited
statuses = database[config['facebook_page']]['mastodon_statuses']
if post['post_id'] == database[config['facebook_page']]['last_post_id']:
if database[config['facebook_page']]['last_edited'] == post['time']:
print('No new posts to mirror')
else:
print('Last post has been updated')
statuses = database[config['facebook_page']]['mastodon_statuses']
for status in statuses:
Mastodon.status_delete(status['id'])
else:

0
vendor/__init__.py vendored

0
split_tweet.py → vendor/split_tweet.py vendored

Loading…
Cancel
Save