Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Pro_Git_ZH.recipe #14

Merged
merged 1 commit into from
Sep 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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