-
-
Save Malasaur/9fc391cfe1f43a4dd5a2a7d5404ef134 to your computer and use it in GitHub Desktop.
theprophecy.page API wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests import post | |
from json import loads | |
def run(word): | |
""" | |
Returns: | |
`None` if `word` is not a valid password | |
A string starting with '/' if `word` is a valid password and returns an URL | |
A general string if `word` is a valid password and returns an easter egg (a message displayed directly on the page | |
""" | |
response = post( | |
"https://www.theprophecy.page/_api/wix-code-public-dispatcher-ng/siteview/_webMethods/backend/passwordLogic.jsw/checkPassword.ajax", | |
params={"gridAppId": "b2464492-4daf-4814-b72e-de73c27ba356","viewMode": "site"}, | |
json=[word], | |
headers={"authorization": "wixcode-pub.061adc1382ab4438ddbec84f66cf9e4c0e5c1a6d.eyJpbnN0YW5jZUlkIjoiOTdmMjc1ZGMtOTgzMy00ZjM4LTkyZTItYTIwNWMzZmEzNDVmIiwiaHRtbFNpdGVJZCI6IjA2YTE4NDZlLWI2YzktNGI5Ni1iZWQxLTcwZGE4MDI1MTNlZCIsInVpZCI6bnVsbCwicGVybWlzc2lvbnMiOm51bGwsImlzVGVtcGxhdGUiOmZhbHNlLCJzaWduRGF0ZSI6MTc0MDQ3NjcyMTk5NSwiYWlkIjoiZWI1MDU2MjQtYjE2NS00MzM0LWE5NzctNTI0ZTI4MTRlMjgzIiwiYXBwRGVmSWQiOiJDbG91ZFNpdGVFeHRlbnNpb24iLCJpc0FkbWluIjpmYWxzZSwibWV0YVNpdGVJZCI6IjcwMGI3NTRhLTg0YzgtNDhmNC1iMmZlLWIwM2UxNTJlN2IzYyIsImNhY2hlIjpudWxsLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwicHJlbWl1bUFzc2V0cyI6IkFkc0ZyZWUsSGFzRG9tYWluLFNob3dXaXhXaGlsZUxvYWRpbmciLCJ0ZW5hbnQiOm51bGwsInNpdGVPd25lcklkIjoiYjQ4MzYxNmUtNjQ5Yy00NDRjLTk4OTgtZTNkMTkyYjdlYWM5IiwiaW5zdGFuY2VUeXBlIjoicHViIiwic2l0ZU1lbWJlcklkIjpudWxsLCJwZXJtaXNzaW9uU2NvcGUiOm51bGwsImxvZ2luQWNjb3VudElkIjpudWxsLCJpc0xvZ2luQWNjb3VudE93bmVyIjpudWxsLCJib3VuZFNlc3Npb24iOiJ1dzJ1c1Y1QTlDY09mUEg1cFFyUUNnSUpqUHpYYl9PcjcyMlA1a09VaW00LklqRTBZamhpWWpJNExXSTBNemN0TkRFeU15MDRPR0prTFRZd016SmlObUV4TmpJMU15SSIsInNlc3Npb25JZCI6bnVsbCwic2Vzc2lvbkNyZWF0aW9uVGltZSI6bnVsbCwic2l0ZUNyZWF0ZWREYXRlIjoiMjAyNS0wMS0zMFQwNjowMDozMi40NDVaIiwiYWNjb3VudENyZWF0ZWREYXRlIjpudWxsfQ=="} | |
) | |
data = loads(response.text)["result"] | |
typ = data["type"] | |
if typ=="none": | |
return None | |
elif typ=="main": | |
return data["pageUrl"] | |
elif typ=="easterEgg": | |
return data["message"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment