Skip to content

Instantly share code, notes, and snippets.

@sophiezhng
Last active June 6, 2021 09:35
Show Gist options
  • Save sophiezhng/89e1f887202da95d92f4b49e1fba7236 to your computer and use it in GitHub Desktop.
Save sophiezhng/89e1f887202da95d92f4b49e1fba7236 to your computer and use it in GitHub Desktop.
Check MySpace Windows 93 notifications for a user
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()
@H3wastooshort
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment