Updated comic pages and comicfury generator.

This commit is contained in:
Bastian Kleineidam 2013-02-14 21:28:53 +01:00
parent deae84d8fa
commit 591df0f814
3 changed files with 217 additions and 58 deletions

View file

@ -23,6 +23,183 @@ activity_matcher = re.compile(r'<b>Activity status:</b> <span class="comicinfo">
# names of comics to exclude
exclude_comics = [
"Archininja", # unsuitable navigation
"Kaze", # unsuitable navigation
"Sweetcheeriosandorangejuice", # unsuitable navigation
"6tsc", # unsuitable navigation
"Coolstorybro", # unsuitable navigation
"BUXY", # unsuitable navigation
"Icannotdraw", # unsuitable navigation
"ProjectX", # unsuitable navigation
"Insectia", # unsuitable navigation
"Oeight", # unsuitable navigation
"ReadershipofOne", # unsuitable navigation
"Haywire", # unsuitable navigation
"Immortalfool", # unsuitable navigation
"BlockTales", # unsuitable navigation
"Goldrush", # unsuitable navigation
"Theredeemers", # unsuitable navigation
"Lovekillsslowly", # unsuitable navigation
"Dotcomic", # unsuitable navigation
"Democomix", # unsuitable navigation
"Crepusculars", # unsuitable navigation
"Xenozone", # unsuitable navigation
"Rocr", # unsuitable navigation
"Mytvisevil", # unsuitable navigation
"Ofpf", # unsuitable navigation
"GRIND", # unsuitable navigation
"Tezzleandzeek", # unsuitable navigation
"Kmlssticks", # unsuitable navigation
"Bidoof", # unsuitable navigation
"Nemution", # unsuitable navigation
"Colorforce", # unsuitable navigation
"CtrlZ", # unsuitable navigation
"Monobow", # unsuitable navigation
"Mars", # unsuitable navigation
"ThornsInOurSide", # unsuitable navigation
"Longandexcitingjourney", # unsuitable navigation
"Unichat", # unsuitable navigation
"Lately", # unsuitable navigation
"Thestickmen", # unsuitable navigation
"Horizongakuen", # unsuitable navigation
"12yearsofmissj", # unsuitable navigation
"3DGlasses", # unsuitable navigation
"Abyss", # unsuitable navigation
"Actdr", # unsuitable navigation
"Aerosol", # unsuitable navigation
"Alienirony", # unsuitable navigation
"AngelguardianEspanol", # unsuitable navigation
"Angryalien", # unsuitable navigation
"Arveytoonz", # unsuitable navigation
"AttackoftheRobofemoids", # unsuitable navigation
"Bedlam", # unsuitable navigation
"Bobcomix", # unsuitable navigation
"Bonejangles", # unsuitable navigation
"Boyaurus", # unsuitable navigation
"Brainfood", # unsuitable navigation
"Bromosworld", # unsuitable navigation
"BulletMythology", # unsuitable navigation
"CafeGruesome", # unsuitable navigation
"Chanpuru", # unsuitable navigation
"Christmaswithmaddog", # unsuitable navigation
"Comicshortsmain", # unsuitable navigation
"Conrads", # unsuitable navigation
"ConradTheCaterpillar", # unsuitable navigation
"ConsequencesOfChoice", # unsuitable navigation
"CoolYuleComics", # unsuitable navigation
"Crossworldsnexus", # unsuitable navigation
"DeadNight", # unsuitable navigation
"Dinosaurkingdom", # unsuitable navigation
"Droned", # unsuitable navigation
"ErraticBeat", # unsuitable navigation
"Evilbear", # unsuitable navigation
"Ewmic", # unsuitable navigation
"Fannicklas", # unsuitable navigation
"Fateofthebluestar", # unsuitable navigation
"Fishbowl", # unsuitable navigation
"Foe", # unsuitable navigation
"Foreignterritory", # unsuitable navigation
"Frigginrandom", # unsuitable navigation
"Frostfire", # unsuitable navigation
"Furnerdy", # unsuitable navigation
"Garfieldminusjon", # unsuitable navigation
"Gatito", # unsuitable navigation
"Gbksayonara", # unsuitable navigation
"Gillimurphyorig", # unsuitable navigation
"Gratz", # unsuitable navigation
"Greygaroutopheavyartwork", # unsuitable navigation
"GrimReaperSchool", # unsuitable navigation
"Hallodri", # unsuitable navigation
"Harrysorehead", # unsuitable navigation
"HazSci", # unsuitable navigation
"Hellboundarchive", # unsuitable navigation
"Herecomesskeeter", # unsuitable navigation
"Holycowcomics", # unsuitable navigation
"Houseescapeold", # unsuitable navigation
"Ign", # unsuitable navigation
"Illusionoftime", # unsuitable navigation
"InsideOuT", # unsuitable navigation
"Jackitandfriends", # unsuitable navigation
"Jenffersshow5", # unsuitable navigation
"Johnsonsuperior", # unsuitable navigation
"Joostdailies", # unsuitable navigation
"Journ", # unsuitable navigation
"JourneyToRaifina", # unsuitable navigation
"Junk", # unsuitable navigation
"KiLAiLO", # unsuitable navigation
"Kingdomprettycure", # unsuitable navigation
"Kmfe", # unsuitable navigation
"Legendoftheredphantom", # unsuitable navigation
"Littlephoenix", # unsuitable navigation
"Llwhoelterran", # unsuitable navigation
"Lomeathandhuilii", # unsuitable navigation
"Mannack", # unsuitable navigation
"MaskoftheAryans", # unsuitable navigation
"Megamaiden", # unsuitable navigation
"Minecraft2b2t", # unsuitable navigation
"Mitadakesaga", # unsuitable navigation
"Mlpfib", # unsuitable navigation
"Monsterloverdp", # unsuitable navigation
"MoonlightValley", # unsuitable navigation
"MurghComics", # unsuitable navigation
"MVPL", # unsuitable navigation
"Natao", # unsuitable navigation
"NMG", # unsuitable navigation
"Noche", # unsuitable navigation
"Noprrkele", # unsuitable navigation
"Nothingfitsartblog", # unsuitable navigation
"Old2g", # unsuitable navigation
"Outtolunch", # unsuitable navigation
"Parisel313", # unsuitable navigation
"Pewfell", # unsuitable navigation
"Phoenix", # unsuitable navigation
"Pi5a", # unsuitable navigation
"Pokemonwarpers", # unsuitable navigation
"Princess", # unsuitable navigation
"Queenie", # unsuitable navigation
"Rain", # unsuitable navigation
"Ratantia", # unsuitable navigation
"Rath", # unsuitable navigation
"RawLatex", # unsuitable navigation
"Remnants", # unsuitable navigation
"Requiem", # unsuitable navigation
"Retrofiyora", # unsuitable navigation
"Rexfordavenue", # unsuitable navigation
"S", # unsuitable navigation
"Sandgate", # unsuitable navigation
"Shadowstories", # unsuitable navigation
"Sigh", # unsuitable navigation
"Slightlyeccentric", # unsuitable navigation
"Smbhax", # unsuitable navigation
"SpiritSquire1", # unsuitable navigation
"Sticklife", # unsuitable navigation
"StickMisadventures", # unsuitable navigation
"StrangerThanFiction", # unsuitable navigation
"SundaySmash", # unsuitable navigation
"Superproultimatewrestling", # unsuitable navigation
"Synapticisms", # unsuitable navigation
"Talesofspoons", # unsuitable navigation
"Terwilligers", # unsuitable navigation
"Thedevilshorn", # unsuitable navigation
"TheEntity", # unsuitable navigation
"Theworldjumper", # unsuitable navigation
"TheWorldofUh", # unsuitable navigation
"Thewriter13", # unsuitable navigation
"ToC", # unsuitable navigation
"TOGM", # unsuitable navigation
"Townburgcity", # unsuitable navigation
"Tuhinaloota", # unsuitable navigation
"UFPA", # unsuitable navigation
"Warg", # unsuitable navigation
"Warrior27", # unsuitable navigation
"Wastedpotential", # unsuitable navigation
"Wcf", # unsuitable navigation
"Whoseline", # unsuitable navigation
"WitchesTeaParty", # unsuitable navigation
"Woohooligan", # unsuitable navigation
"XWingAlliance", # unsuitable navigation
"Yppcomic", # unsuitable navigation
"Zeroeffort", # unsuitable navigation
]

File diff suppressed because one or more lines are too long

View file

@ -18,32 +18,21 @@ class Status:
error = "error"
orphan = "orphan"
indextemplate = u"""
---
extends: base.j2
title: Dosage comic list
description: a list of comic strips supported by Dosage
---
{%% block js %%}
<script src="{{ media_url('js/masonry.min.js') }}"></script>
{%% endblock js %%}
{%% block content %%}
<section id="main-content">
<h2>Dosage comic list</h2>
<div id="comics">
%(content)s
</div>
<script>
window.onload = function() {
var wall = new Masonry(document.getElementById('comics'), {
columnWidth: 240
});
};
</script>
</section>
{%% endblock content %%}
comicdata_template = u"""
/* generated on %(date)s */
$(document).ready(function() {
$('#comics').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="comictable"></table>');
$('#comictable').dataTable( {
"aaData": [
%(content)s
],
"aoColumns": [
{ "sTitle": "Name" },
{ "sTitle": "Genre" },
{ "sTitle": "Status" }
]
} );
} );
"""
comic_template = u"""
@ -71,21 +60,22 @@ title: Dosage comic %(name)s
<tr>
<th>Status</th><td>%(status)s on %(date)s</td>
</tr>
<tr>
<th>Rating</th><td><div class="g-plusone" data-size="standard" data-annotation="bubble"
data-href="%(url)s"></div></td>
</tr>
</table>
<div class="g-plusone" data-size="standard" data-annotation="inline" data-width="300"></div>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</section>
{%% endblock content %%}
"""
entrytemplate_url = u"""
<a href="%(url)s" title="%(title)s" class="%(css)s">%(name)s</a>
"""
entrytemplate_nourl = u"""
<span title="%(title)s" class="%(css)s">%(name)s</span>
"""
def get_mtime (filename):
"""Return modification time of filename."""
@ -159,7 +149,7 @@ def get_testentry(line):
"name": name,
"url": scraper.url,
"description": scraper.description,
"genre": "",
"genre": "Other", # XXX
"error": None,
"adult": scraper.adult,
}
@ -178,39 +168,31 @@ def update_testentry(key, entry, testinfo):
testinfo[key] = entry
def get_html_index(testinfo):
"""Get HTML content for test output index."""
res = []
def get_comicdata(testinfo):
"""Get comic data for table listing."""
rows = []
for key in sorted(testinfo.keys()):
entry = testinfo[key]
css = entry["status"]
url = "comics/%s.html" % key
if entry["error"]:
title = entry["error"]
elif entry["description"]:
title = entry["description"][:100]
else:
title = entry["name"]
args = {
"url": quote(url),
"title": quote(title),
"css": quote(css),
"status": quote(entry["status"]),
"name": quote(entry["name"]),
"genre": quote(entry.get("genre", "Other")),
}
template = entrytemplate_url if url else entrytemplate_nourl
entryhtml = template % args
res.append('<div class="item">%s</div>' % entryhtml)
return os.linesep.join(res)
row = '["<a href=\\"%(url)s\\">%(name)s</a>", "%(genre)s", "%(status)s"]' % args
rows.append(row)
return u",\n".join(rows)
def write_html(testinfo, outputdir, modified):
"""Write index page and all comic pages."""
content = get_html_index(testinfo)
content = get_comicdata(testinfo)
date = strdate(modified)
args = {"date": quote(date), "content": content}
fname = os.path.join(outputdir, "comic_index.html")
fname = os.path.join(outputdir, "media", "js", "comicdata.js")
with codecs.open(fname, 'w', 'utf-8') as fp:
fp.write(indextemplate % args)
fp.write(comicdata_template % args)
comicdir = os.path.join(outputdir, "comics")
if not os.path.isdir(comicdir):
os.mkdir(comicdir)
@ -224,7 +206,7 @@ def write_html_comic(key, entry, outputdir, date):
"url": quote(entry["url"]),
"name": quote(entry["name"]),
"adult": quote("yes" if entry["adult"] else "no"),
"genre": quote(entry["genre"]),
"genre": quote(entry.get("genre", "Other")),
"description": quote(entry["description"]),
"status": quote(entry["status"]),
"date": quote(date),