Skip to content

Instantly share code, notes, and snippets.

@frafra frafra/ilpost.recipe
Created Jul 13, 2018

What would you like to do?
Calibre recipe for "Il Post"
#!/usr/bin/env python2
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from import BasicNewsRecipe
class IlPost(BasicNewsRecipe):
title = "Il Post"
language = "it"
tags = "news"
#feeds = [""]
cover_url = ""
ignore_duplicate_articles = {"url"}
no_stylesheets = True
keep_only_tags = [dict(id=["expanding", "singleBody"])]
prefixes = ["Permalink to", "Commenta"]
def parse_index(self):
soup = self.index_to_soup("")
entries = []
for link in soup.findAll('a', href=True, title=True):
if not link["href"].startswith(""):
title = link["title"]
for prefix in self.prefixes:
if title.startswith(prefix):
title = title.lstrip(prefix)
title = title.strip()
"url": link["href"],
"title": title,
return [("Il Post", entries)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.