~dosage-dev/dosage/bunch-of-comics

« back to all changes in this revision

Viewing changes to dosage/plugins/f.py

  • Committer: ns
  • Date: 2009-12-15 04:28:11 UTC
  • Revision ID: ns@ww1aviationlinks.cjb.net-20091215042811-0ayhj9rts8elo3pg
repair Bhag

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from re import compile, IGNORECASE, MULTILINE
 
2
 
 
3
from dosage.helpers import BasicScraper, PHPScraper, indirectStarter
 
4
 
 
5
 
 
6
class FalconTwin(BasicScraper):
 
7
    latestUrl = 'http://www.falcontwin.com/'
 
8
    imageUrl = 'http://www.falcontwin.com/index.html?strip=%s'
 
9
    imageSearch = compile(r'"(strips/.+?)"')
 
10
    prevSearch = compile(r'"prev"><a href="(index.+?)"')
 
11
    help = 'Index format: nnn'
 
12
 
 
13
 
 
14
class FauxPas(BasicScraper):
 
15
    latestUrl = 'http://www.ozfoxes.net/cgi/pl-fp1.cgi'
 
16
    imageUrl = 'http://www.ozfoxes.net/cgi/pl-fp1.cgi?%s'
 
17
    imageSearch = compile(r'<img .*src="(.*fp/fp.*(png|jpg|gif))"')
 
18
    prevSearch = compile(r'<a href="(pl-fp1\.cgi\?\d+)">Previous Strip')
 
19
    help = 'Index format: nnn'
 
20
 
 
21
 
 
22
class FeyWinds(BasicScraper):
 
23
    imageUrl = 'http://kitsune.rydia.net/comic/page.php?id=%s'
 
24
    imageSearch = compile(r"(../comic/pages//.+?)'")
 
25
    prevSearch = compile(r"(page.php\?id=.+?)'.+?navprevious.png")
 
26
    help = 'Index format: n (unpadded)'
 
27
    starter = indirectStarter('http://kitsune.rydia.net/index.html',
 
28
                              compile(r'(comic/page.php\?id.+?)"'))
 
29
 
 
30
 
 
31
class FightCastOrEvade(BasicScraper):
 
32
    latestUrl = 'http://www.fightcastorevade.net/'
 
33
    imageUrl = 'http://www.fightcastorevade.net/d/%s'
 
34
    imageSearch = compile(r'"(.+?/comics/.+?)"')
 
35
    prevSearch = compile(r'"(.+?/d/.+?)".+?previous')
 
36
    help = 'Index format: yyyymmdd.html'
 
37
 
 
38
 
 
39
class FilibusterCartoons(BasicScraper):
 
40
    latestUrl = 'http://www.filibustercartoons.com/'
 
41
    imageUrl = 'http://www.filibustercartoons.com/archive?id=%s'
 
42
    imageSearch = compile(r'<img src="(comics/\d{8}\..+?)"')
 
43
    prevSearch = compile(r'<a href="(archive.php\?id=\d{8})".+?\'images/comic_nav_prev_2.gif\'')
 
44
    help = 'Index format: n (unpadded)'
 
45
 
 
46
 
 
47
class FlakyPastry(BasicScraper):
 
48
    latestUrl = 'http://flakypastry.runningwithpencils.com/index.php'
 
49
    imageUrl = 'http://flakypastry.runningwithpencils.com/comic.php\?strip_id=%s'
 
50
    imageSearch = compile(r'<img src="(comics/.+?)"')
 
51
    prevSearch = compile(r'<a href="(.+?)".+?btn_back')
 
52
    help = 'Index format: nnnn'
 
53
 
 
54
 
 
55
class Flipside(BasicScraper):
 
56
    latestUrl = 'http://www.flipsidecomics.com/comic.php'
 
57
    imageUrl = 'http://www.flipsidecomics.com/comic.php?i=%s'
 
58
    imageSearch = compile(r'<IMG SRC="(comic/.+?)"')
 
59
    prevSearch = compile(r'<A HREF="(comic.php\?i=\d+?)">&lt')
 
60
    help = 'Index format: nnnn'
 
61
 
 
62
 
 
63
class Footloose(BasicScraper):
 
64
    latestUrl = 'http://footloosecomic.com/footloose/today.php'
 
65
    imageUrl = 'http://footloosecomic.com/footloose/pages.php?page=%s'
 
66
    imageSearch = compile(r'<img src="/footloose/(.+?)"')
 
67
    prevSearch = compile(r'(?:first.+?[^>]).+?(/footloose/.+?)".+?(?:prev)')
 
68
#    prevSearch = compile(r'(?:first.+?[^>]).+?(/footloose/.+?html).+?(?:prev|Prev)')
 
69
    help = 'Index format: n (unpadded)'
 
70
 
 
71
 
 
72
class FragileGravity(BasicScraper):
 
73
    latestUrl = 'http://www.fragilegravity.com/'
 
74
    imageUrl = 'http://www.fragilegravity.com/core.php?archive=%s'
 
75
    imageSearch = compile(r'<img src="(strips/\d{8}\..+?)"')
 
76
    prevSearch = compile(r'<a href="(core.php\?archive=\d{8})"\nonmouseover="window.status=\'Previous Strip.+?\'; return true"')
 
77
    help = 'Index format: yyyymmdd'
 
78
 
 
79
 
 
80
class Freefall(BasicScraper):
 
81
    latestUrl = 'http://freefall.purrsia.com/default.htm'
 
82
    imageUrl = 'http://freefall.purrsia.com/ff1100/fv%s.htm'
 
83
    imageSearch = compile(r'<img src="(/ff\d{3}\d?/fv\d{5}\..+?)"')
 
84
    prevSearch = compile(r'<a href="(/ff\d{3}\d?/fv\d{5}\.htm)">Previous')
 
85
    help = 'Index format: nnnnn'
 
86
 
 
87
 
 
88
class Frump(PHPScraper):
 
89
    basePath = 'http://thm.askee.net/comic/'
 
90
    prevSearch = compile(r'<a href="(http://thm\.askee\.net/comic/daily\.php\?date=\d{6})">Previous', IGNORECASE)
 
91
 
 
92
 
 
93
class FantasyRealms(BasicScraper):
 
94
    # This module may not get the latest comic, since the front page references to
 
95
    # the first page of the last update. If an update consists of multiple pages,
 
96
    # only the first one is fetched, the others are fetched on the next
 
97
    # update...
 
98
 
 
99
    imageUrl = 'http://www.fantasyrealmsonline.com/manga/%s.html'
 
100
    imageSearch = compile(r'<div align="center"><a href="[^"]+\.html"><img src="(\w+\.jpg)"')
 
101
    prevSearch = compile(r'<a href="([^"]+\.html)"><img src="\.\./\.\./images/nav-back')
 
102
    help = 'Index format: ii/pp (issue/page)'
 
103
    starter = indirectStarter('http://www.fantasyrealmsonline.com/',
 
104
                              compile(r'<a href = "(manga/\d+/\w+\.html)"><img src="latest\.jpg"'))
 
105
 
 
106
 
 
107
class FullFrontalNerdity(BasicScraper):
 
108
    latestUrl = 'http://nodwick.humor.gamespy.com/ffn/index.php'
 
109
    imageUrl = None
 
110
    imageSearch = compile(r'<img src="(http://nodwick.humor.gamespy.com/ffn/strips/[^"]*)"', IGNORECASE)
 
111
    prevSearch = compile(r'<a href="(index.php\?date=[0-9-]*)"><img src="back.jpg"', IGNORECASE)
 
112
 
 
113
 
 
114
class FunInJammies(BasicScraper):
 
115
    latestUrl = 'http://www.funinjammies.com/'
 
116
    imageUrl = 'http://www.funinjammies.com/comic.php?issue=%s'
 
117
    imageSearch = compile(r'(/comics/.+?)"')
 
118
    prevSearch = compile(r'(/comic.php.+?)" id.+?prev')
 
119
    help = 'Index format: n (unpadded)'
 
120
 
 
121
 
 
122
class Fallen(BasicScraper):
 
123
    imageUrl = 'http://www.fallencomic.com/pages/part%s/%s-p%s.htm'
 
124
    imageSearch = compile(r'<IMG SRC="(page/\d+-p\d+\..+?)"', IGNORECASE)
 
125
    prevSearch = compile(r'<A HREF="(\d+-p\d+.htm)"><FONT FACE="Courier">Back', IGNORECASE)
 
126
    help = 'Index format: nn-m (comicNumber-partNumber)'
 
127
    starter = indirectStarter('http://www.fallencomic.com/fal-page.htm',
 
128
                              compile(r'\(NEW \d{2}/\d{2}/\d{2}\)\s*\n*\s*<a href="(pages/part\d+/\d+-p\d+\.htm)">\d+</a>', MULTILINE))
 
129
 
 
130
    def namer(cls, imageUrl, pageUrl):
 
131
        return imageUrl.split('/')[-1].split('.')[0]
 
132
 
 
133
    def setStrip(self, index):
 
134
        index, part = index.split('-')
 
135
        self.currentUrl = self.imageUrl % (part, index, part)