This commit is contained in:
spla 2021-05-19 14:49:29 +02:00
pare 7fe1bb7470
commit 44a8bd0332

Veure arxiu

@ -1,26 +1,14 @@
#from six.moves import urllib
import datetime import datetime
#from subprocess import call
from mastodon import Mastodon from mastodon import Mastodon
#import time import time
#import threading
#import csv
import os import os
import json import json
#import time
#import signal
import sys import sys
import os.path import os.path
import requests
import operator import operator
#import redis
#import calendar
import psycopg2 import psycopg2
import pdb import pdb
#from decimal import *
#getcontext().prec = 2
def mastodon(): def mastodon():
# Load secrets from secrets file # Load secrets from secrets file
@ -119,8 +107,6 @@ if __name__ == '__main__':
conn.close() conn.close()
print("Current users: %s "% current_id)
############################################################################### ###############################################################################
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
@ -388,11 +374,12 @@ if __name__ == '__main__':
print("Tooting...") print("Tooting...")
print(toot_text) print(toot_text)
if len(toot_text) < 500: if len(toot_text) < 500:
mastodon.status_post(toot_text, in_reply_to_id=None, ) #mastodon.status_post(toot_text, in_reply_to_id=None, )
print("blah")
else: else:
toot_text1, toot_text2 = toot_text[:int(len(toot_text)/2)], toot_text[int(len(toot_text)/2):] toot_text1, toot_text2 = toot_text[:int(len(toot_text)/2)], toot_text[int(len(toot_text)/2):]
toot_id = mastodon.status_post(toot_text1, in_reply_to_id=None,) toot_id = mastodon.status_post(toot_text1, in_reply_to_id=None,)
mastodon.status_post(toot_text2, in_reply_to_id=toot_id,) #mastodon.status_post(toot_text2, in_reply_to_id=toot_id,)
print(toot_text1) print(toot_text1)
print(toot_text2) print(toot_text2)