Hello! If you're here you're probably looking to validate the results of a draw or perform a draw yourself. Please read through the following sections before doing so though!
- Python >=3.5
- The
PRAWpackage (pip3 install praw) - The
tqdmpackage (pip3 install tqdm)
threads: Link to the drawing thread(s), if multiple, add a new set of{}!CID_Filename: The filename of the comment ID fileDateline: The maximum creation time of a user's account in epoch time. Everything younger will end up inDQ-Age. Set to-1, or the future to disable this check.Duplicate Action: DQ: Delete all duplicate authors' comments or FirstOnly: Delete all but first commentWinnerFromFile: Which comment list to draw from - Truncated or OriginalDrawTime: Time the draw starts in epoch time. Starts counting blocks from this timeWaitTillBlock: The n-th block which will be the "winning block". Default: 3Win_Hash: Hash of the winning block. Auto-filled via API if blank. If present, will be used bygetWinner.
Everything else should fill up automatically after running the scripts!
Obtain client id and secret from here. User agent can be anything.
main- Launcher for the other scripts, also checks dependencies.getComments- Gets comments from threads specified and saves tometa.json/CID_Filenamefile.dupeCmtCheck- Checks comment IDs for duplicates.getAuthors- Gets author usernames based on the comments collected. Users who deleted their comments will show up as 'Null'. Also generatesDQ-Age.txt, which contains usernames of accounts which were created aftermeta.json/dateline.removeInvalid- Removes comments associated with 'Null', 'NULL*' orDQ-Age.txtusers.
Users who double post either have all their comments deleted, or only have their first one remaingetWinner- Gets the winner of the draw. If run before draw, will wait untilmeta.json/DrawTimeand then wait for the winning block to be mined. Once mined, the winner will be displayed and saved tometa.json.
As a time-saving measure (specifically for large threads), getComments and getAuthors
will both ask if you are 'Updating' the existing comment list when launched:
- Responding
Y/ywill only update entries in the comment list that require updating, such as a new comment, or a comment without an associated author; - Otherwise, the scripts will start from scratch and overwrite any and all previous data.
Please do take note that the comments and/or user account statuses may have changed since the draw. This could be due to users deleting comments or their account.
As such, getComments and getAuthors will probably return a different list of IDs. Only the other scripts may be run with the provided ID, author and DQ lists; These should return the same results.
Also, the files are (mostly) made in Linux, so if you're using another OS, the newline character may differ, resulting in a hashsum mismatch.