adastrafanfic can have chapters with tags (<i>) in them. Allow get as well as post.

This commit is contained in:
retiefjimm 2011-03-15 14:49:16 -05:00
parent e6ebd956f8
commit e645c054d8
3 changed files with 8 additions and 1 deletions

View file

@ -113,7 +113,9 @@ class Adastrafanfic(FanfictionSiteAdapter):
for o in allOptions:
# warning=5 bypasses 'are you old enough' checks.
url = self.url + "&warning=5&chapter=%s" % o['value']
title = o.string
# ad astra can have tags, like <i> in chapter titles.
title = "%s" % o
title = re.sub('<[^>]+>','',title)
result.append((url,title))
# warning=5 bypasses 'are you old enough' checks.

View file

@ -474,6 +474,8 @@ def replaceNotEntities(data):
def removeEntities(text):
# replace numeric versions of [&<>] with named versions.
if text is None:
return text
try:
t = text.decode('utf-8')
except UnicodeEncodeError, e:

View file

@ -171,6 +171,9 @@ class RecentAllFilesServer(webapp.RequestHandler):
self.response.out.write(template.render(path, template_values))
class FanfictionDownloader(webapp.RequestHandler):
def get(self):
self.post()
def post(self):
logging.getLogger().setLevel(logging.DEBUG)