diff --git a/recipes/hackernews.recipe b/recipes/hackernews.recipe index bae34b183b..e7bf7d690a 100644 --- a/recipes/hackernews.recipe +++ b/recipes/hackernews.recipe @@ -15,13 +15,14 @@ import re class HNWithCommentsLink(BasicNewsRecipe): - title = 'HN With Comments Link' + title = 'HN With Actual Comments' __author__ = 'Tom Scholl & David Kerschner' description = u'Hacker News, run by Y Combinator. Anything that good hackers would find interesting, with a focus on programming and startups.' publisher = 'Y Combinator' category = 'news, programming, it, technology' delay = 1 - max_articles_per_feed = 30 + max_articles_per_feed = 20 + oldest_article = 3 use_embedded_content = False no_stylesheets = True encoding = 'utf-8' @@ -29,7 +30,8 @@ class HNWithCommentsLink(BasicNewsRecipe): requires_version = (0, 8, 16) feeds = [ - (u'Hacker News', 'https://news.ycombinator.com/rss') + (u'Hacker News Frontpage', 'https://hnrss.org/frontpage'), + (u'Ask Hacker News', 'https://hnrss.org/ask') ] temp_files = [] @@ -49,8 +51,10 @@ class HNWithCommentsLink(BasicNewsRecipe): soup = self.index_to_soup(url) main = soup.find('tr').findNextSiblings('tr', limit=2)[1].td - title = self.tag_to_string(main.find('td', 'title')) - link = main.find('td', 'title').find('a')['href'] + title_element = main.select('td.title .titleline a')[0] + title = self.tag_to_string(title_element) + link = title_element['href'] + # link = main.find('td', 'title').find('a')['href'] if link.startswith('item?'): link = 'https://news.ycombinator.com/' + link readable_link = link.rpartition('http://')[2].rpartition('https://')[2] @@ -88,11 +92,12 @@ class HNWithCommentsLink(BasicNewsRecipe): return u'