Skip to content

Commit

Permalink
Updated Reddit
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonymousRandomPerson committed Jul 20, 2023
1 parent 3312604 commit 55b1432
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions data/read-ids.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12726,3 +12726,6 @@ zznclm
147stk6
147spg0
147ktca
15444b4
1543wp9
1541d09
8 changes: 4 additions & 4 deletions tools/redditcrawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def set_flair(submission, flair):

print(f"{submission.id}: Processing...")

if submission.link_flair_text == "New Entry" or submission.link_flair_text == "Edit Entry" or True:
if submission.link_flair_text == "New Entry" or submission.link_flair_text == "Edit Entry":

try:

Expand All @@ -122,9 +122,9 @@ def set_flair(submission, flair):
if submission_json:

if submission.link_flair_text == "Edit Entry":
assert submission_json["id"] > 0, "Edit invalid because ID is tampered, it must not be 0 or -1!"
assert submission_json["id"] != -1, "Edit invalid because ID is tampered, it must not be -1!"
else:
assert submission_json["id"] <= 0, "Addition invalid because ID is tampered, it must be 0 or -1!"
assert submission_json["id"] == -1, "Addition invalid because ID is tampered, it must be -1!"

submission_json_dummy = {"id": submission_json["id"], "_reddit_id": submission.id, "_author": submission.author.name}

Expand All @@ -137,7 +137,7 @@ def set_flair(submission, flair):
assert validation_status < 3, \
"Submission invalid after validation. This may be caused by not enough points on the path."

with open(f'{patches_dir}reddit-{submission.id}-{"-".join(submission["name"].split()).lower()}.json', 'w', encoding='utf-8') as out_file:
with open(f'{patches_dir}reddit-{submission.id}-{"-".join(submission.name.split()).lower()}.json', 'w', encoding='utf-8') as out_file:
out_file.write(json.dumps(submission_json, ensure_ascii=False))

count_success += 1
Expand Down
1 change: 1 addition & 0 deletions web/all-authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5560,3 +5560,4 @@ GDJosef
eri531
-Yox-
gh:Slymeball
Annilee_Rose2
Loading

0 comments on commit 55b1432

Please sign in to comment.