#!/usr/bin/python print 'content-type: text/html' print import mod,cgitb cgitb.enable() if mod.checklog(): mod.swagin() username = mod.par('username') magic = mod.par('id') print ''' <html> <head> <title>Home</title> <link rel="stylesheet" type="text/css" href="profile.css"> <LINK REL="SHORTCUT ICON" HREF="favicon.png"> </head> <body> '''+mod.nav()+''' <center> <form action="addfunc.py" method="get"> Name of Show:<input type="text" name="showname"><br><br> Synopsis (optional):<br> <textarea name="synopsis" cols="50" rows="5"></textarea> <input type="hidden" name="username" value="'''+username+'''"> <input type="hidden" name="id" value="'''+magic+'''"><br> <table class="hometable"><col width="400"><tr><td><font size="1"> * Please be respectful and add shows that exist. Try to use the original Japanese name and capitalize the first letter of each word. Any griefers will be banished for eternity </font></td></td></table> <input type="submit" value="Make Post" class="post"> </form>
#!/usr/bin/python print 'content-type: text/html' print import mod,cgitb,cgi cgitb.enable() def l(DATA): return '<li>'+DATA+'</li>' if mod.checklog(): mod.swagin() username = mod.par('username') magic = mod.par('id') form = cgi.FieldStorage() if 'completed' in form: completed = mod.par('completed') listfile = open('lists/'+username,'r') thelist = listfile.read().split('\n<li>') listfile.close() for x in range(len(thelist)): showdata = thelist[x].split('status:') if showdata[0]==completed: showdata[1] = 'Completed' thelist[x] = 'status:'.join(showdata) break editfile = open('lists/'+username,'w') editfile.write('\n<li>'.join(thelist)) editfile.close() elif 'upto' in cgi.FieldStorage(): completed = mod.par('show') listfile = open('lists/'+username,'r')
#!/usr/bin/python print 'content-type: text/html' print import mod,cgitb,cgi cgitb.enable() def l(DATA): return '<li>'+DATA+'</li>' if mod.checklog(): mod.swagin() user = mod.par('user') magic = mod.par('id') listfile = open('lists/'+user,'r') thelist = listfile.read() listfile.close() mod.style('profile.css',user+"'s List") print mod.nav() print '<h2>'+user+"'s anime list</h2>" if thelist != '': print '<ul>' thelist = thelist.split('\n<li>') for x in thelist: stuff = x.split('status:') listing = stuff[0] listing += '<br>Status: '+stuff[1] if stuff[1] == 'Watching': listing += '<br>Seen '+stuff[2]+' episodes' print l(listing) else: print '<h3>'+user+' has not added any shows to their watch list yet</h3>'
#!/usr/bin/python print 'content-type: text/html' print import mod,cgi,os,cgitb cgitb.enable() if mod.checklog(): form = cgi.FieldStorage() mod.swagin() anime = mod.par('anime') magic = mod.par('id') username = mod.par('username') rating = mod.par('rate') infofile = open('info/'+anime,'r') info = infofile.read() infofile.close() newfile = open('info/'+anime,'w') info = info.split('\nINFOSPLIT\n') ratings = info[1].split('\n') ratings.append(rating) ratings = '\n'.join(ratings) info[1] = ratings rated = info[2].split('\n') rated.append(username) rated = '\n'.join(rated) info[3] = rated info = '\nINFOSPLIT\n'.join(info) newfile.write(info) newfile.close() print '<head><title>Redirecting...</title></head><meta http-equiv="refresh" content="0; ratings.py?username='******'username'].value+'&id='+magic+'&anime='+anime+'" />'
#!/usr/bin/python print 'content-type: text/html' print import mod,cgitb,cgi,os cgitb.enable() form = cgi.FieldStorage() if mod.checklog(): mod.swagin() mallist = open('mal','r') allanime=mallist.readlines() if not mod.par('showname') in allanime: ip = os.environ["REMOTE_ADDR"] log=open('addlog.txt','a') log.write(mod.par('username')+':'+str(ip)+':'+mod.par('showname')+'\n') log.close() mallist = open('mal','a') mallist.write('\n'+mod.par('showname')) mallist.close() info = open('info/'+mod.par('showname'),'w') data = [] data.append(mod.par('showname')) data.append('') if len(form)==3: data.append('-') else: data.append(mod.par('synopsis')) data.append('') info.write('\nINFOSPLIT\n'.join(data))
#returns wether or not a string is a subtring of an element in a list def subinlist(string, l): for x in l: if string in x.lower(): return True return False if mod.checklog(): mod.swagin() malfile = open('mal', 'r') mal = malfile.read().split('\n') mal.sort() maldict = {} username = mod.par('username') form = cgi.FieldStorage() magic = mod.par('id') # mod.style('theprofile.css','List of Anime') print '''<html> <head> <title>Home</title> <link rel="stylesheet" type="text/css" href="profile.css"> <LINK REL="SHORTCUT ICON" HREF="favicon.png"> </head> <body> ''' + mod.nav() + ''' <center> ''' print '<br><br>'
cgitb.enable() #returns wether or not a string is a subtring of an element in a list def subinlist(string,l): for x in l: if string in x.lower(): return True return False if mod.checklog(): mod.swagin() malfile=open('mal','r') mal = malfile.read().split('\n') mal.sort() maldict = {} username = mod.par('username') form = cgi.FieldStorage() magic = mod.par('id') # mod.style('theprofile.css','List of Anime') print '''<html> <head> <title>Home</title> <link rel="stylesheet" type="text/css" href="profile.css"> <LINK REL="SHORTCUT ICON" HREF="favicon.png"> </head> <body> '''+mod.nav()+''' <center> '''
#!/usr/bin/python print 'content-type: text/html' print import mod, cgitb, cgi cgitb.enable() def l(DATA): return '<li>' + DATA + '</li>' if mod.checklog(): mod.swagin() user = mod.par('user') magic = mod.par('id') listfile = open('lists/' + user, 'r') thelist = listfile.read() listfile.close() mod.style('profile.css', user + "'s List") print mod.nav() print '<h2>' + user + "'s anime list</h2>" if thelist != '': print '<ul>' thelist = thelist.split('\n<li>') for x in thelist: stuff = x.split('status:') listing = stuff[0] listing += '<br>Status: ' + stuff[1] if stuff[1] == 'Watching': listing += '<br>Seen ' + stuff[2] + ' episodes'