~ubuntu-branches/debian/experimental/calibre/experimental

« back to all changes in this revision

Viewing changes to recipes/gry_online_pl.recipe

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-08-16 09:55:40 UTC
  • mfrom: (1.3.35)
  • Revision ID: package-import@ubuntu.com-20120816095540-yfaxheew17jv19l5
Tags: 0.8.64+dfsg-1
* New upstream release:
  - Update license of the quick start guide to be DFSG compatible. Thanks to
    Christophe Siraut for sorting this out! (Closes: #653328)
* debian/control: Add new libmtp-dev build dependency.
* debian/control: Stricter python-mechanize dependency. (Closes: #684616)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from calibre.web.feeds.recipes import BasicNewsRecipe
2
2
 
3
 
class Gry_online_pl(BasicNewsRecipe):
 
3
class GryOnlinePl(BasicNewsRecipe):
4
4
    title          = u'Gry-Online.pl'
5
5
    __author__        = 'fenuks'
6
6
    description   = 'Gry-Online.pl - computer games'
21
21
        tag = appendtag.find('div', attrs={'class':'n5p'})
22
22
        if tag:
23
23
            nexturls=tag.findAll('a')
24
 
            for nexturl in nexturls[1:]:
25
 
                try:
26
 
                    soup2 = self.index_to_soup('http://www.gry-online.pl/S020.asp'+ nexturl['href'])
27
 
                except:
28
 
                    soup2 = self.index_to_soup('http://www.gry-online.pl/S022.asp'+ nexturl['href'])
 
24
            url_part = soup.find('link', attrs={'rel':'canonical'})['href']
 
25
            url_part = url_part[25:].rpartition('?')[0]
 
26
            for nexturl in nexturls[1:-1]:
 
27
                soup2 = self.index_to_soup('http://www.gry-online.pl/' + url_part + nexturl['href'])
29
28
                pagetext = soup2.find(attrs={'class':'gc660'})
30
29
                for r in pagetext.findAll(name='header'):
31
30
                    r.extract()
 
31
                for r in pagetext.findAll(attrs={'itemprop':'description'}):
 
32
                    r.extract()
32
33
                pos = len(appendtag.contents)
33
34
                appendtag.insert(pos, pagetext)
34
 
            for r in appendtag.findAll(attrs={'class':['n5p', 'add-info', 'twitter-share-button']}):
 
35
            for r in appendtag.findAll(attrs={'class':['n5p', 'add-info', 'twitter-share-button', 'lista lista3 lista-gry']}):
35
36
                r.extract()
36
37
 
37
38