Skip to content

Commit

Permalink
Merge pull request #14 from Abirdcfly/patch-2
Browse files Browse the repository at this point in the history
Create Pro_Git_ZH.recipe
  • Loading branch information
ericzhang-cn committed Sep 5, 2014
2 parents 92ee838 + 32fd80c commit 80da17a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions calibre-recipes/Pro_Git_ZH.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from calibre.web.feeds.recipes import BasicNewsRecipe

class Pro_Git_ZH(BasicNewsRecipe):

title = 'Pro_Git_ZH'
description = 'Pro_Git_Chinese'
cover_url = 'http://iissnan.com/progit/assets/img/pro-git-cover.jpeg'

url_prefix = 'http://iissnan.com/progit/'
no_stylesheets = True
keep_only_tags = [{ 'class': 'col-md-8' }]

def parse_index(self):
soup = self.index_to_soup(self.url_prefix)

div = soup.find('ul', { 'class': 'toc' })

articles = []
for link in div.findAll('a'):

til = link.contents[0].strip()
url = self.url_prefix +'/'+ link['href']
a = { 'title': til, 'url': url }

articles.append(a)

ans = [('Pro_Git_ZH', articles)]

return ans

0 comments on commit 80da17a

Please sign in to comment.