Delete hatenadir directory

This commit is contained in:
Rekushi authored and GitHub committed 2026-08-31 20:18:07 +01:00
1 parent 3382bcb6da
commit 77fe278280
41 files changed
-3121

No files matched your search

-1
View File
@@ -1 +0,0 @@
����������������������������������������������������������������ςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σςς�Σ�Σςς�Σ�Σ�Σ�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�ΣΟ‚�Σςςςς�ΣΟ‚�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�ΣΟ‚�Σςςςς�ΣΟ‚�Σ�Σ�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςςςςςςςς�Σ�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σςς�Σ�Σ�Σ�Σ�Σ�Σςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σςςς�Σ�Σ�Σ�Σ�Σ�Σςςς�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σςςςς�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςς�Σ�Σςςςς�Σ�Σ�Σ�Σςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σςςςςςςςςςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςςςςςςςςςςςςς�Σςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςςςς�Σςςςςςςςςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςςςςςςς�Σςςςςςςςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σςςςςςςςςςςςςςςς�Σςςςςςς�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςς�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σ�Σςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςςς����������������������������������������������������������������
@@ -1 +0,0 @@
���������������サ纎ロワ������������������������ン�モォョ完完完完完諌�5ササ゚������������������ン�ソョ完完完完完完完完完完完寄椢ロ���������������xマョ完完完完完諌儒�潁漬式完完完完岐「ワ������������5キョ完完完�5」垤�ヌ�ヒ�ヒ�ヒ�ヒ�ヒシソxッム聴完完官噛゚����������ッョ完完岐埆サ�ヒ�ヒ�ヒ�ヒ�ヒWォョ岸テ�ヒ�ヒ�ヒyウョ完完完噛゚��������Vテョ完完碍ァ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォョ寄繭キ�ヒ�ヒ�ヒシソミ聴完完款������壙ョ完完蓋ォ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォョ完完官�6ァンテ�ヒンテミ聴完貫������ミ粍完�4」�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォッ式完完完官孜ウ�ヒワソョ完完楽モ����燮ョ完諌釣ヌ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ�シソ5」ョ完完官爵テ�ヒ垤ョ完観�����ョ完噛キ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヌWォョ完棺サ�ヒ�ヒ�ョ完噛ラ��ワ�完諌�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ5」ョ岸テ�ヒ�ヒ垤ョ完�ォ��Wテョ完�5」�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヌミ�6ァ�ヒ�ヒ�ヒ�ヌョ完完��ウョ完噛キ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒンテ��ヒ�ヒ�ヒ�ヒ�ヒ�ョ完款��ョ完款ソ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ4洌完鎌ラ�ム坩完岸テ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ5」ョ完岳マ�ム坩完岸テ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ5」ョ完岳マ��ョ完棺サ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ洌完噛ラ�5サョ完岳ッ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ョ完含�yモョ完�5」�ヒ�ヒ�ヒ�ヒ�ヒンテxッ漑�6ァササWォ��ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒンテョ完観��ン�完官岸テ�ヒ�ヒ�ヒ6ァョ完完完完完諌梯�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒWォョ完�5キ���4キョ完碍ァ�ヒ�ヒシソョ完完完完完完完岐�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒンテッ完完棺���サ羂完完款ソ�ヒササョ完完完完完完完岐�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒVァョ完岐ヲ�����ウョ完諌釣テ�ヒ�ョ完完完完完官湿ソ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ匍ョ完完棺�����シ�完完�巫テ�ヒyウWォ��6ァyウ�ヌ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒササョ完完�4ウ�������壤ョ完完寄吊ソ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒxッョ完完寄���������xマョ完完完学ォ�ヌ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒ�ヒササ洌完完諌吊����������壅ョ完完完諌�5」垤ンデテ�ヌ゙テササxッ岼完完完岐ヲ�������������シ�ォョ完完完完完完完完完完完完完完蓋ヌ����������������サ゚ッョ完完完完完完完完完官桟ソワ�������������������ワ�マッム墟佃漬梯「5ササ゚�������������������������������������������
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
RQBuAGcAbABpAHMAaAA= en
1 RQBuAGcAbABpAHMAaAA= en
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,94 +0,0 @@
from twisted.web import resource
from twisted.internet import reactor
import time
from hatena import Log, NotFound
from DB import Database
from Hatenatools import UGO
#makes a flipnote list of the most seen ones among the recently uploaded
class PyResource(resource.Resource):
isLeaf = True
def __init__(self):
resource.Resource.__init__(self)
self.pages = []#10 first pages
self.newestview = None
self.newestflip = None
self.Update()
def render(self, request):
page = int(request.args["page"][0]) if "page" in request.args else 1
if len(self.pages) >= page:
path = "/".join(request.path.split("/")[3:])
Log(request, "%s page %i" % (path, page))
request.responseHeaders.setRawHeaders('content-type', ['text/plain'])
return self.pages[page-1]
else:
return NotFound.render(request)
#===
def Update(self):#called every 15 minutes
reactor.callLater(60*10, self.Update)
if self.newestflip <> Database.Newest[0] or self.newestview <> Database.Views:
self.newestflip = Database.Newest[0]
self.newestview = Database.Views
reactor.callInThread(self.UpdateThreaded, Database.Newest)
def UpdateThreaded(self, flipnotes):#run in an another thread
#sort the flipnotes by viewcount, affected by amount of stars
def sort((i, (ID, flip))):
views, stars = Database.GetFlipnote(ID, flip)[1:3]
return int(views)*60 + int(stars)/4 - i
flipnotes = map(lambda x: x[1], sorted(enumerate(flipnotes), key=sort)[::-1])[:500]
#create pages:
pages = []
pagecount = (len(flipnotes)-1)/50 + 1
if pagecount > 10: pagecount = 10#temp?
flipcount = len(flipnotes) if len(flipnotes) < 500 else 500
for i in xrange(pagecount):
pages.append(self.MakePage(flipnotes[i*50:i*50+50], i+1, i<pagecount-1, flipcount))
if self.pages:#not on startup
print time.strftime("[%H:%M:%S] Updated hotmovies.ugo")
self.pages = pages
def MakePage(self, flipnotes, page, next, count):
ugo = UGO()
ugo.Loaded = True
ugo.Items = []
#meta
ugo.Items.append(("layout", (2, 1)))
ugo.Items.append(("topscreen text", ["Popular Flipnotes", "Flipnotes", str(count), "", "The most popular new Flipnotes."], 0))
#categories
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls", "Most Popular", True))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/likedmovies.uls", "Most Liked", False))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/recommended.uls", "Recommended", False))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/newmovies.uls", "New Flipnotes", False))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/following.uls", "New Favourites", False))
#the "post flipnote" button
ugo.Items.append(("unknown", ("3", "http://flipnote.hatena.com/ds/v2-xx/help/post_howto.htm", "UABvAHMAdAAgAEYAbABpAHAAbgBvAHQAZQA=")))
#previous page
if page > 1:
ugo.Items.append(("button", 115, "Previous", "http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls?page=%i" % (page-1), ("", ""), None))
#Flipnotes
for creatorid, filename in flipnotes:
stars = str(Database.GetFlipnote(creatorid, filename)[2])
ugo.Items.append(("button", 3, "", "http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.ppm" % (creatorid, filename), (stars, "765", "573", "0"), (filename+".ppm", Database.GetFlipnoteTMB(creatorid, filename))))
#next page
if next:
ugo.Items.append(("button", 115, "Next", "http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls?page=%i" % (page+1), ("", ""), None))
return ugo.Pack()
@@ -1,94 +0,0 @@
from twisted.web import resource
from twisted.internet import reactor
import time
from hatena import Log, NotFound
from DB import Database
from Hatenatools import UGO
#makes a flipnote list of the most seen ones among the recently uploaded
class PyResource(resource.Resource):
isLeaf = True
def __init__(self):
resource.Resource.__init__(self)
self.pages = []#10 first pages
self.neweststar = None
self.newestflip = None
reactor.callLater(2, self.Update)#or it'll clash with the others in the terminal
def render(self, request):
page = int(request.args["page"][0]) if "page" in request.args else 1
if len(self.pages) >= page:
path = "/".join(request.path.split("/")[3:])
Log(request, "%s page %i" % (path, page))
request.responseHeaders.setRawHeaders('content-type', ['text/plain'])
return self.pages[page-1]
else:
return NotFound.render(request)
#===
def Update(self):#called every 15 minutes
reactor.callLater(60*10, self.Update)
if self.newestflip <> Database.Newest[0] or self.neweststar <> Database.Stars:
self.newestflip = Database.Newest[0]
self.neweststar = Database.Stars
reactor.callInThread(self.UpdateThreaded, Database.Newest)
def UpdateThreaded(self, flipnotes):#run in an another thread
#sort the flipnotes by viewcount, affected by amount of stars
def sort((i, (ID, flip))):
views, stars = Database.GetFlipnote(ID, flip)[1:3]
return int(stars)*110 + int(views)/10 - i
flipnotes = map(lambda x: x[1], sorted(enumerate(flipnotes), key=sort)[::-1])[:500]
#create pages:
pages = []
pagecount = (len(flipnotes)-1)/50 + 1
if pagecount > 10: pagecount = 10#temp?
flipcount = len(flipnotes) if len(flipnotes) < 500 else 500
for i in xrange(pagecount):
pages.append(self.MakePage(flipnotes[i*50:i*50+50], i+1, i<pagecount-1, flipcount))
if self.pages:#not on startup
print time.strftime("[%H:%M:%S] Updated likedmovies.ugo")
self.pages = pages
def MakePage(self, flipnotes, page, next, count):
ugo = UGO()
ugo.Loaded = True
ugo.Items = []
#meta
ugo.Items.append(("layout", (2, 1)))
ugo.Items.append(("topscreen text", ["Liked Flipnotes", "Flipnotes", str(count), "", "The most liked new Flipnotes."], 0))
#categories
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls", "Most Popular", False))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/likedmovies.uls", "Most Liked", True))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/recommended.uls", "Recommended", False))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/newmovies.uls", "New Flipnotes", False))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/following.uls", "New Favourites", False))
#the "post flipnote" button
ugo.Items.append(("unknown", ("3", "http://flipnote.hatena.com/ds/v2-xx/help/post_howto.htm", "UABvAHMAdAAgAEYAbABpAHAAbgBvAHQAZQA=")))
#previous page
if page > 1:
ugo.Items.append(("button", 115, "Previous", "http://flipnote.hatena.com/ds/v2-xx/frontpage/likedmovies.uls?page=%i" % (page-1), ("", ""), None))
#Flipnotes
for creatorid, filename in flipnotes:#[i*50 : i*50+50]:
stars = str(Database.GetFlipnote(creatorid, filename)[2])
ugo.Items.append(("button", 3, "", "http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.ppm" % (creatorid, filename), (stars, "765", "573", "0"), (filename+".ppm", Database.GetFlipnoteTMB(creatorid, filename))))
#next page
if next:
ugo.Items.append(("button", 115, "Next", "http://flipnote.hatena.com/ds/v2-xx/frontpage/likedmovies.uls?page=%i" % (page+1), ("", ""), None))
return ugo.Pack()
@@ -1,89 +0,0 @@
from twisted.web import resource
from twisted.internet import reactor
import time
from hatena import Log, NotFound
from DB import Database
from Hatenatools import UGO
#makes a flipnote list of the newest flipnotes
class PyResource(resource.Resource):
isLeaf = True
def __init__(self):
resource.Resource.__init__(self)
self.pages = []#10 first pages
self.newestflip = None
reactor.callLater(4, self.Update)#or it'll clash with the others in the terminal
def render(self, request):
page = int(request.args["page"][0]) if "page" in request.args else 1
if len(self.pages) >= page:
path = "/".join(request.path.split("/")[3:])
Log(request, "%s page %i" % (path, page))
request.responseHeaders.setRawHeaders('content-type', ['text/plain'])
return self.pages[page-1]
#elif (page-1)*50 < len(Database.Newest):
# pass
else:
return NotFound.render(request)
#===
def Update(self):#called every minute
reactor.callLater(60, self.Update)
if self.newestflip <> Database.Newest[0]:
self.newestflip = Database.Newest[0]
reactor.callInThread(self.UpdateThreaded, Database.Newest)
def UpdateThreaded(self, flipnotes):#run in an another thread
#create pages:
pages = []
pagecount = (len(flipnotes)-1)/50 + 1
if pagecount > 10: pagecount = 10#temp?
flipcount = len(flipnotes)
for i in xrange(min((pagecount, 10))):
pages.append(self.MakePage(flipnotes[i*50:i*50+50], i+1, i<pagecount-1, flipcount))
if self.pages:#not on startup
print time.strftime("[%H:%M:%S] Updated newmovies.ugo")
self.pages = pages
def MakePage(self, flipnotes, page, next, count):
ugo = UGO()
ugo.Loaded = True
ugo.Items = []
#meta
ugo.Items.append(("layout", (2, 1)))
ugo.Items.append(("topscreen text", ["New Flipnotes", "Flipnotes", str(count), "", "The newest Flipnotes submitted."], 0))
#categories
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls", "Most Popular", False))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/likedmovies.uls", "Most Liked", False))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/recommended.uls", "Recommended", False))
ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/newmovies.uls", "New Flipnotes", True))
#ugo.Items.append(("category", "http://flipnote.hatena.com/ds/v2-xx/frontpage/following.uls", "New Favourites", False))
#the "post flipnote" button
ugo.Items.append(("unknown", ("3", "http://flipnote.hatena.com/ds/v2-xx/help/post_howto.htm", "UABvAHMAdAAgAEYAbABpAHAAbgBvAHQAZQA=")))
#previous page
if page > 1:
ugo.Items.append(("button", 115, "Previous", "http://flipnote.hatena.com/ds/v2-xx/frontpage/newmovies.uls?page=%i" % (page-1), ("", ""), None))
#Flipnotes
for creatorid, filename in flipnotes:#[i*50 : i*50+50]:
stars = str(Database.GetFlipnote(creatorid, filename)[2])
ugo.Items.append(("button", 3, "", "http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.ppm" % (creatorid, filename), (stars, "765", "573", "0"), (filename+".ppm", Database.GetFlipnoteTMB(creatorid, filename))))
#next page
if next:
ugo.Items.append(("button", 115, "Next", "http://flipnote.hatena.com/ds/v2-xx/frontpage/newmovies.uls?page=%i" % (page+1), ("", ""), None))
return ugo.Pack()
-1
View File
@@ -1 +0,0 @@
<html>␍ <head>␍ <title>Info</title>␍ <meta name="uppertitle" content="Info">␍ <link rel="stylesheet" type="text/css" href="http://flipnote.hatena.com/css/ds/common.css">␍ </head>␍ <body>␍ <div class="container">␍ <div class="title" align="center">pbsds's Hatena Server</div>␍ <div class="news-body">␍ <p>This server is a proof of concept server. There's not much functionality yet because it's in early stages. Please enjoy your stay.</p>␍ </div>␍ </div>␍ </body>␍</html>
-1
View File
@@ -1 +0,0 @@
<html>␍ <head>␍ <title>Post Flipnote</title>␍ <meta name="uppertitle" content="Post Flipnote">␍ <meta name="postchannelbutton" content="http://flipnote.hatena.com/ds/v2-xx/post/flipnote.post">␍ <link rel="stylesheet" type="text/css" href="http://flipnote.hatena.com/css/ds/common.css">␍ </head>␍ <body>␍ <div class="container">␍ <div class="title" align="center">Posting a Flipnote</div>␍ <div class="news-body">␍ <p>Posting a flipnote is as easy as pressing the button down below and selecting the flipnote you want to upload!</p>␍ </div>␍ </div>␍ </body>␍</html>
-20
View File
@@ -1,20 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<ugo_xml>
<layout>
<value>2</value>
<value>1</value>
</layout>
<title>
<label>Inbox</label>
<label />
<label />
<label />
<label />
<num>0</num>
</title>
<button>
<label>Info</label>
<address>http://flipnote.hatena.com/ds/v2-xx/help/info.htm</address>
<trait>3</trait>
</button>
</ugo_xml>
-29
View File
@@ -1,29 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<ugo_xml>
<layout>
<value>0</value>
</layout>
<title>
<label />
<label />
<label />
<label />
<label />
<num>0</num>
</title>
<button>
<label>Browse Flipnotes</label>
<address>http://flipnote.hatena.com/ds/v2-xx/frontpage/hotmovies.uls</address>
<trait>100</trait>
<value />
<value>0</value>
</button>
<button>
<label>Info</label>
<address>http://flipnote.hatena.com/ds/v2-xx/help/info.htm</address>
<trait>0</trait>
<value />
<value>0</value>
<embedded_file>__ntfts/News.ntft</embedded_file>
</button>
</ugo_xml>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-251
View File
@@ -1,251 +0,0 @@
from twisted.web import resource
import os
from hatena import Log, ServerLog, Silent, NotFound
from DB import Database
from Hatenatools import TMB
#The movie folder:
class PyResource(resource.Resource):
isLeaf = False
def __init__(self):
resource.Resource.__init__(self)
self.CreatorID = CreatorIDResource()
def getChild(self, name, request):
if Database.CreatorExists(name):
return self.CreatorID
elif name == "":
return self
else:
return NotFound
def render(self, request):
request.setResponseCode(403)
return "403 - Denied access"
#The creator ID folder:
class CreatorIDResource(resource.Resource):
isLeaf = False
def __init__(self):
resource.Resource.__init__(self)
self.CreatorIDFile = CreatorIDFileResource()
def getChild(self, name, request):
CreatorID = request.path.split("/")[-2]
filename = ".".join(name.split(".")[:-1])
if Database.FlipnoteExists(CreatorID, filename):#html, ppm and info
return self.CreatorIDFile
elif name == "":
return self
else:
return NotFound
def render(self, request):
request.setResponseCode(403)
return "403 - Denied access"
#Any public file inside creator ID folder:
class CreatorIDFileResource(resource.Resource):
isLeaf = True
def __init__(self):
resource.Resource.__init__(self)
def render(self, request):
creator, file = request.path.split("/")[-2:]
filetype = file.split(".")[-1].lower()
if filetype in "ppm":
#log it:
path = "/".join(request.path.split("/")[3:])
Log(request, path)
#add a view:
Database.AddView(creator, file[:-4])
#read ppm file:
data = Database.GetFlipnotePPM(creator, file[:-4])
#send file to the client:
request.responseHeaders.setRawHeaders('content-type', ['text/plain'])
return data
elif filetype == "info":
path = "/".join(request.path.split("/")[3:])
Log(request, path, True)
request.responseHeaders.setRawHeaders('content-type', ['text/plain'])
return "0\n0\n"#undocumented what it means
elif filetype == "htm":
#maybe cache the details page of Database.Newest?
if "mode" in request.args:
if request.args["mode"][0] == "commentshalfsize":
pass
return self.GenerateDetailsPage(creator, ".".join(file.split(".")[:-1])).encode("UTF-8")
elif filetype == "star":
path = "/".join(request.path.split("/")[3:])
color = request.args.get('starcolor', ["yellow"])[0] # colour of star, can be green, red, blue, or purple. Yellow otherwise.
headers = request.getAllHeaders()
#bad formatting
if "x-hatena-star-count" not in headers:
ServerLog.write("%s got 403 when requesting %s without a X-Hatena-Star-Count header" % (request.getClientIP(), path), Silent)
request.setResponseCode(403)
return "403 - Denied access\nRequest lacks a X-Hatena-Star-Count http header"
#add the stars:
amount = int(headers["x-hatena-star-count"])
if (amount < 1) or (amount > 65535):
ServerLog.write("%s got 403 when requesting %s with an invalid X-Hatena-Star-Count header" % (request.getClientIP(), path), Silent)
request.setResponseCode(403)
return "403 - Denied access\nRequest has an invalid X-Hatena-Star-Count http header"
if not Database.AddStar(creator, file[:-5], amount, color):
#error
ServerLog.write("%s got 500 when requesting %s" % (request.getClientIP(), path), Silent)
request.setResponseCode(500)
return "500 - Internal server error\nAdding the stars seem to have failed."
#report success
ServerLog.write("%s added %i %s stars to %s/%s.ppm" % (request.getClientIP(), amount, color, creator, file[:-5]), Silent)
return "Success"
elif filetype == "dl":
path = "/".join(request.path.split("/")[3:])
Log(request, path, True)
#this is POSTed to when it've been stored to memory.
Database.AddDownload(creator, file[:-3])
return "Noted ;)"
else:
path = "/".join(request.path.split("/")[3:])
ServerLog.write("%s got 403 when requesting %s" % (request.getClientIP(), path), Silent)
request.setResponseCode(403)
return "403 - Denied access"
#details page
def GenerateDetailsPage(self, CreatorID, filename):#filename without ext
flipnote = Database.GetFlipnote(CreatorID, filename)#flipnote = [filename, views, stars, green stars, red stars, blue stars, purple stars, Channel], all probably strings
if not flipnote:
return "This flipnote doesn't exist!"
tmb = TMB().Read(Database.GetFlipnoteTMB(CreatorID, filename))
if not tmb:
return "This flipnote is corrupt!"
#Is it a spinoff?
Spinnoff = ""
if tmb.OriginalAuthorID <> tmb.EditorAuthorID or tmb.OriginalFilename <> tmb.CurrentFilename:
if Database.FlipnoteExists(tmb.OriginalAuthorID, tmb.OriginalFilename[:-4]):
Spinnoff = SpinoffTemplate1.replace("%%CreatorID%%", tmb.OriginalAuthorID).replace("%%Filename%%", tmb.OriginalFilename[:-4])
elif tmb.OriginalAuthorID <> tmb.EditorAuthorID:
Spinnoff = SpinoffTemplate2
#make each entry:
Entries = []
#Creator username:
name = "Creator"
#content = "<a href=\"http://flipnote.hatena.com/ds/ds/v2-xx/%s/profile.htm?t=260&pm=80\">%s</a>" % (CreatorID, tmb.EditorAuthorName)
content = '<a href="http://flipnote.hatena.com/ds/v2-xx/%s/profile.htm?t=260&pm=80\">%s</a>' % (CreatorID, tmb.Username)
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
#Stars:
name = "Stars"
content = u'<a href="http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.htm?mode=stardetail"><span class="star0c">\u2605</span> <span class="star0">%s</span></a>' % (CreatorID, filename, flipnote[2])#yellow stars
content += u'<br/><a href="http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.htm?mode=stardetail"><span class="star1c">\u2605</span> <span class="star1">%s</span></a>' % (CreatorID, filename, flipnote[3])#green stars
content += u'<br/><a href="http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.htm?mode=stardetail"><span class="star2c">\u2605</span> <span class="star2">%s</span></a>' % (CreatorID, filename, flipnote[4])#red stars
content += u'<br/><a href="http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.htm?mode=stardetail"><span class="star3c">\u2605</span> <span class="star3">%s</span></a>' % (CreatorID, filename, flipnote[5])#blue stars
content += u'<br/><a href="http://flipnote.hatena.com/ds/v2-xx/movie/%s/%s.htm?mode=stardetail"><span class="star4c">\u2605</span> <span class="star4">%s</span></a>' % (CreatorID, filename, flipnote[6])#purple stars
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
#Views:
name = "Views"
content = str(flipnote[1])
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
# Downloads:
name = "Downloads"
content = str(flipnote[8])
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
#Channel:
if flipnote[7]:#todo: make channels work at all
name = "Channel"
content = 'a href="http://flipnote.hatena.com/ds/v2-xx/ch/%s.uls">%s</a>' % (flipnote[7], flipnote[7])
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
#Comments:
Comments = "0"
#doto: add original author info too
#add the entries to page:
return DetailsPageTemplate.replace("%%CreatorID%%", CreatorID).replace("%%Filename%%", filename).replace("%%CommentCount%%", Comments).replace("%%Spinoff%%", Spinnoff).replace("%%PageEntries%%", PageEntrySeparator.join(Entries))
#templates:
DetailsPageTemplate = """<html>
<head>
<title>Flipnote by %%Username%%</title>
<meta name="upperlink" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.ppm">
<meta name="starbutton" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.star">
<meta name="starbutton1" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.star?starcolor=green,9001">
<meta name="starbutton2" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.star?starcolor=red,9001">
<meta name="starbutton3" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.star?starcolor=blue,9001">
<meta name="starbutton4" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.star?starcolor=purple,9001">
<meta name="savebutton" content="http://flipnote.hatena.com/ds/v2-xx/movie/%%CreatorID%%/%%Filename%%.ppm">
<meta name="playcontrolbutton" content="">
<link rel="stylesheet" href="http://flipnote.hatena.com/css/ds/basic.css">
</head>
<body>
<table width="240" border="0" cellspacing="0" cellpadding="0" class="tab">
<tr>
<td class="border" width="5" align="center">
<div class="border"></div>
</td>
<td class="border" width="70" align="center">
<div class="border"></div>
</td>
<td class="border" width="95" align="center">
<div class="border"></div>
</td>
</tr>
<tr>
<td class="space"> </td>
<td class="tabon" align="center">
<div class="on" align="center">Description</div>
</td>
<td class="taboff" align="center">
<a class="taboff" href="http://flipnote.hatena.com/ds/v2-eu/movie/%%CreatorID%%/%%Filename%%.htm?mode=commentshalfsize">Comments(%%CommentCount%%)</a>
</td>
</tr>
</table>
<div class="pad5b"></div>%%Spinoff%%
<table width="226" border="0" cellspacing="0" cellpadding="0" class="detail">%%PageEntries%%
</table>
</body>
</html>"""
SpinoffTemplate1 = """
<div class="notice2" align="center">
This Flipnote is a spin-off.<br>
<a href="http://flipnote.hatena.com/ds/v2-eu/movie/%%CreatorID%%/%%Filename%%.htm">Original Flipnote</a>
</div>"""
SpinoffTemplate2 = """
<div class="notice2" align="center">
This Flipnote is a spin-off.
</div>"""
PageEntryTemplate = """
<tr>
<th width="90">
<div class="item-term" align="left">%%Name%%</div>
</th>
<td width="136">
<div class="item-value" align="right">
%%Content%%
</div>
</td>
</tr>"""
PageEntrySeparator="""
<tr> </tr>
<tr>
<td colspan="2">
<div class="hr"></div>
</td>
</tr>"""
-33
View File
@@ -1,33 +0,0 @@
from twisted.web import resource
from twisted.internet import reactor
import time
from hatena import ServerLog, Silent
from DB import Database
from Hatenatools import TMB
#Handle flipnote uploads
class PyResource(resource.Resource):
isLeaf = True
def render_GET(self, request):
ServerLog.write("%s got 403 when requesting post/flipnote.post with GET" % (request.getClientIP()), Silent)
request.setResponseCode(405)
return "405 - Method Not Allowed"
def render_POST(self, request):#implement channels?
data = request.content.read()
channel = ""
if "channel" in request.args:
channel = request.args["channel"][0]
add = Database.AddFlipnote(data, channel)
if add:
ServerLog.write("%s successfully uploaded \"%s.ppm\"" % (request.getClientIP(), add[1]), Silent)
request.setResponseCode(200)
else:
ServerLog.write("%s tried to upload a flipnote, but failed..." % request.getClientIP(), Silent)
request.setResponseCode(500)#only causes an error, need to fix
return ""
#===