mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Works in progress by barakplasma
Merge branch 'add-works-in-progress' of https://github.com/barakplasma/calibre
This commit is contained in:
commit
20cabde561
37
recipes/works_in_progress.recipe
Normal file
37
recipes/works_in_progress.recipe
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class WorksInProgress(BasicNewsRecipe):
|
||||||
|
title = 'Works in progress'
|
||||||
|
description = 'Works in Progress is an online magazine dedicated to sharing new and underrated ideas to improve the world, and features original writing from some of the most interesting thinkers in the world'
|
||||||
|
cover_url = "https://www.worksinprogress.co/wp-content/uploads/2020/03/logo-1.svg"
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
auto_cleanup = True
|
||||||
|
publication_type = 'magazine'
|
||||||
|
language = 'en'
|
||||||
|
index = "https://www.worksinprogress.co/"
|
||||||
|
__author__ = "barakplasma"
|
||||||
|
|
||||||
|
def parse_index(self):
|
||||||
|
soup = self.index_to_soup(self.index)
|
||||||
|
feeds = []
|
||||||
|
|
||||||
|
for section in soup.find_all('div', 'issue-loop'):
|
||||||
|
section_title = section['data-section-id']
|
||||||
|
section_items = []
|
||||||
|
|
||||||
|
for article in section.find_all('div', 'issue-intro'):
|
||||||
|
title = article.find('h2', 'issue-title').text
|
||||||
|
url = article.find_all('a')[1]['href']
|
||||||
|
author = article.find('a', 'author').text
|
||||||
|
section_items.append({
|
||||||
|
"title": title,
|
||||||
|
"url": url,
|
||||||
|
"author": author
|
||||||
|
})
|
||||||
|
|
||||||
|
feeds.append((section_title, section_items))
|
||||||
|
|
||||||
|
return feeds
|
Loading…
x
Reference in New Issue
Block a user