Last active
June 6, 2021 09:35
-
-
Save sophiezhng/89e1f887202da95d92f4b49e1fba7236 to your computer and use it in GitHub Desktop.
Check MySpace Windows 93 notifications for a user
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
import json | |
import requests | |
user_id = "" #ENTER YOUR ID INSIDE THE QUOTES e.g., user_id = "31453" | |
def main(): | |
r = requests.get('https://myspace.windows93.net/api.php?id='+user_id) | |
user = make_json_request(r) | |
notifs = user['notifications'] | |
changes_exist = False | |
if notifs['new fwiend requests'] == True: | |
print("You have new fwiend requests!") | |
changes_exist = True | |
if notifs['new message'] == True: | |
print("You have messages!") | |
changes_exist = True | |
if notifs['new comment'] == True: | |
print("You have new comment(s)!") | |
changes_exist = True | |
if notifs['new blog comment'] == True: | |
print("You have new blog comment(s)!") | |
changes_exist = True | |
if changes_exist == False: | |
print('Nothing new') | |
def make_json_request(request): | |
json = request.json() | |
if json["success"] == 'false': | |
print("ERROR: "+json["msg"]) | |
exit(1) | |
else: | |
return json | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made mine into a gist too: https://gist.github.com/HACKER-3000/3f0c36a27621487301da12263e0c3d60