From 788a2c72e80c8610cbad02375a179a96fc0bb95e Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Tue, 10 Jul 2018 00:29:56 +0300 Subject: [PATCH] Fixed the bug that causes tagging all the posts' type as null --- src/searcher.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/searcher.py b/src/searcher.py index 9eb24ad..c5a490b 100644 --- a/src/searcher.py +++ b/src/searcher.py @@ -349,16 +349,15 @@ def redditSearcher(posts,SINGLE_POST=False): except AttributeError: continue - postsFile.add({subCount:[details]}) - details = checkIfMatching(submission) + result = checkIfMatching(submission) - if details is not None: - if not details["postType"] == "self": - orderCount += 1 - printSubmission(submission,subCount,orderCount) - subList.append(details) - else: - postsFile.add({subCount:[details]}) + if result is not None: + details = result + orderCount += 1 + printSubmission(submission,subCount,orderCount) + subList.append(details) + + postsFile.add({subCount:[details]}) if not len(subList) == 0: print(