Sfoglia il codice sorgente

fixing bug: not checking soup posts if already posted; configpath errormessage was also misleading

master
Andreas Demmelbauer 6 anni fa
parent
commit
abaefe3372
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +5
    -5
      tootbot.py

+ 5
- 5
tootbot.py Vedi File

@@ -24,8 +24,8 @@ try:
config = json.load(open(configpath))

except:
print("didn't find config file: ", configpath)
print("ERROR: Config file not found!")
print("Problem reading config file: ", configpath)
print("ERROR: Config file not found or invalid!")
sys.exit(1)


@@ -192,13 +192,13 @@ for p in reversed(s.entries):
last = db.fetchone()

print('Processing: %s' % p.id)

shouldpost = True

if last is not None:
shouldpost = False
print("skip: already posted")
# process only unprocessed tweets less than n days old

shouldpost = True

posttime = datetime(p.published_parsed.tm_year, p.published_parsed.tm_mon, p.published_parsed.tm_mday, p.published_parsed.tm_hour, p.published_parsed.tm_min, p.published_parsed.tm_sec)
age = datetime.now() - posttime
if age > timedelta(days=days):


Caricamento…
Annulla
Salva