1__license__ = 'GPL v3'
2__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
3
4'''
5Fetch Anandtech.
6'''
7
8from calibre.web.feeds.news import BasicNewsRecipe
9
10
11class anan(BasicNewsRecipe):
12
13    title = 'Anandtech'
14    description = 'comprehensive Hardware Tests'
15    __author__ = 'Oliver Niesner, Armin Geller'  # 2014-02-27 AGE: update
16    use_embedded_content = False
17    language = 'en'
18    timefmt = ' [%d %b %Y]'
19    oldest_article = 7
20    max_articles_per_feed = 40
21    no_stylesheets = True
22    remove_javascript = True
23    encoding = 'utf-8'
24
25    cover_url = 'http://www.anandtech.com/content/images/globals/header_logo.png'
26    masthead_url = 'http://www.anandtech.com/content/images/globals/printheader.png'
27
28    keep_only_tags = [
29        dict(name='section', attrs={'class': ['main_cont']}),
30    ]
31    remove_tags = [
32        dict(name='div', attrs={'class': ['print',
33                                          'breadcrumb_area noprint',
34                                          'fl-rt noprint',
35                                          'blog_top_right', ]})
36    ]
37
38    feeds = [('Anandtech', 'http://www.anandtech.com/rss/')]
39
40    def print_version(self, url):
41        # return url.replace("0Cshow0C", "0Cprint0C") # 2013-09-07 AGE: update
42        return url.replace("/show/", "/print/")  # 2014-02-27 AGE: update
43