Преглед на файлове

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

master
Andreas Demmelbauer преди 6 години
родител
ревизия
abaefe3372
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. +5
    -5
      tootbot.py

+ 5
- 5
tootbot.py Целия файл

@@ -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):


Зареждане…
Отказ
Запис