DDS Notifications Script
I present to you:
- 4 Generations of adapting to different MySpace clones
- not fully tested
- may blow your pc up
the
NOTIFICATION SCRIPT!!!
import json
import requests
import time
from playsound import playsound
user_id = "23" #Enter you user IDs here. Put them in quotes and seperate them by commas
session_cookie = "nope" #enter the value of the 'session' cookie (BE CAREFUL! THIS CAN BE USED TO COMPROMISE YOUR ACCOUNT
last_state = False
def check():
try:
r = requests.get('https://damedanespace.com/u/'+user_id+'/user.json', cookies={'session' : session_cookie})
except requests.exceptions.ConnectionError:
print("ConnectionError")
return
except:
print("Error")
return
user = make_json_request(r)
if user == False:
print("API Error")
return
try:
notifs = user['notifications']
except:
print("you probably need to renew your session cookie in the script");
changes_exist = False
#print("For " + user_id + ": ")
print("For " + user['name'] + ":")
if notifs['friendrequests'] == True:
print("You have new fwiend requests!")
changes_exist = True
if notifs['friends'] == True:
print("You have new friends!")
changes_exist = True
if notifs['mail'] == True:
print("You have unread messages!")
changes_exist = True
if notifs['comments'] == True:
print("You have new comments!")
changes_exist = True
if changes_exist == False:
print('Nothing new')
global last_state
if changes_exist and not last_state:
playsound("notify.wav")
last_state = changes_exist
print("")
def make_json_request(request):
json = request.json()
if json["error"] != None:
print("ERROR: " + json["error"])
return False
else:
return json
while True:
check()
time.sleep(3)