Skip to content

Commit

Permalink
Make NYT* recipes DRYer [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Jul 23, 2023
1 parent e6a9270 commit 67c8238
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
5 changes: 5 additions & 0 deletions recipes/includes/nyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@


class NYTRecipe(BasicNewsrackRecipe):
use_embedded_content = False
auto_cleanup = False
compress_news_images_auto_size = 10
ignore_duplicate_articles = {"title", "url"}

delay = 0
simultaneous_downloads = 1
delay_range = list(range(2, 5))
Expand Down
4 changes: 0 additions & 4 deletions recipes/nytimes-books.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ class NYTimesBooks(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe):
publication_type = "newspaper"
oldest_article = 7 # days
max_articles_per_feed = 25
use_embedded_content = False

auto_cleanup = False
scale_news_images = (600, 600)

remove_attributes = ["style", "font"]
remove_tags_before = [dict(id="story")]
Expand Down
4 changes: 0 additions & 4 deletions recipes/nytimes-global.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class NYTimesGlobal(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe):

oldest_article = 1 # days
max_articles_per_feed = 20
use_embedded_content = False

auto_cleanup = False
ignore_duplicate_articles = {"title", "url"}

remove_attributes = ["style", "font"]
remove_tags_before = [dict(id="story")]
Expand Down
4 changes: 0 additions & 4 deletions recipes/nytimes-magazine.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class NYTimesBooks(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe):
publication_type = "magazine"
oldest_article = 7 # days
max_articles_per_feed = 25
use_embedded_content = False

auto_cleanup = False
scale_news_images = (600, 600)

remove_attributes = ["style", "font"]
remove_tags_before = [dict(id="story")]
Expand Down
2 changes: 0 additions & 2 deletions recipes/nytimes-paper.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class NewYorkTimesPrint(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe):
language = "en"
publication_type = "newspaper"
masthead_url = "https://mwcm.nyt.com/.resources/mkt-wcm/dist/libs/assets/img/logo-nyt-header.svg"
ignore_duplicate_articles = {"title", "url"}
compress_news_images_auto_size = 10

INDEX = "https://www.nytimes.com/section/todayspaper"

Expand Down

0 comments on commit 67c8238

Please sign in to comment.