forked from Plurmp/WholesomeListSubBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_entry_detection.py
30 lines (27 loc) · 1008 Bytes
/
new_entry_detection.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import json
import submission
def check_new_entry(god_list, local_list):
for item in god_list:
if item['link'] not in local_list.keys():
submission.post_doujin(
title=item["title"],
author=item["author"],
tier=item["tier"],
pages=item["pages"],
tags=item["tags"],
link=item["link"],
warning=item['warning']
)
with open("local.json", "a") as a:
json.dump(
{item['link']: {
'title': item['title'],
'author': item['author'],
'warning': item['warning'],
'parody': item['parody'],
'tier': item['tier'],
'pages': item['pages'],
'tags': item['tags'],
}},
fp=a
)