1#!/usr/local/bin/python3.8
2__license__ = 'GPL v3'
3__author__ = 'Lorenzo Vigentini'
4__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
5__version__ = 'v1.01'
6__date__ = '14, January 2010'
7__description__ = 'PC World and Macworld consistently deliver editorial excellence through award-winning content and trusted product reviews.'
8
9'''
10http://www.pcworld.com/
11'''
12
13from calibre.web.feeds.news import BasicNewsRecipe
14from calibre.ptempfile import PersistentTemporaryFile
15
16temp_files = []
17articles_are_obfuscated = True
18
19
20class pcWorld(BasicNewsRecipe):
21    __author__ = 'Lorenzo Vigentini'
22    description = 'PC World and Macworld consistently deliver editorial excellence through award-winning content and trusted product reviews.'
23    cover_url = 'http://images.pcworld.com/images/common/header/header-logo.gif'
24
25    title = 'PCWorld '
26    publisher = 'IDG Communication'
27    category = 'PC, video, computing, product reviews, editing, cameras, production'
28
29    language = 'en'
30    timefmt = '[%a, %d %b, %Y]'
31
32    oldest_article = 7
33    max_articles_per_feed = 20
34    use_embedded_content = False
35    recursion = 10
36
37    remove_javascript = True
38    no_stylesheets = True
39    auto_cleanup = True
40
41    def get_obfuscated_article(self, url):
42        br = self.get_browser()
43        br.open(url + '&print')
44
45        response = br.follow_link(url, nr=0)
46        html = response.read()
47
48        self.temp_files.append(PersistentTemporaryFile('_fa.html'))
49        self.temp_files[-1].write(html)
50        self.temp_files[-1].close()
51        return self.temp_files[-1].name
52
53    feeds = [
54        (u'All Stories', u'http://www.pcworld.com/index.rss'),
55        (u'Reviews', u'http://www.pcworld.com/reviews/index.rss'),
56        (u'How-To', u'http://www.pcworld.com/howto/index.rss'),
57        (u'Video', u'http://www.pcworld.com/video/index.rss'),
58        (u'Game On', u'http://www.pcworld.com/column/game-on/index.rss'),
59        (u'Hassle free PC', u'http://www.pcworld.com/column/hassle-free-pc/index.rss'),
60        (u'Go Social', u'http://www.pcworld.com/column/go-social/index.rss'),
61        (u'Linux Line', u'http://www.pcworld.com/column/linux-line/index.rss'),
62        (u'Net Work', u'http://www.pcworld.com/column/net-work/index.rss'),
63        (u'Security Alert', u'http://www.pcworld.com/column/security-alert/index.rss'),
64        (u'Simply Business', u'http://www.pcworld.com/column/simply-business/index.rss'),
65        (u'Business', u'http://www.pcworld.com/category/business/index.rss'),
66        (u'Security & Privacy', u'http://www.pcworld.com/category/privacy/index.rss'),
67        (u'Windows', u'http://www.pcworld.com/category/windows/index.rss'),
68        (u'Laptops', u'http://www.pcworld.com/category/laptop-computers/index.rss'),
69        (u'Software', u'http://www.pcworld.com/category/software/index.rss'),
70        (u'Desktops', u'http://www.pcworld.com/category/desktop-computers/index.rss'),
71        (u'Printers', u'http://www.pcworld.com/category/printers/index.rss'),
72        (u'Phones', u'http://www.pcworld.com/category/phones/index.rss'),
73        (u'Tablets', u'http://www.pcworld.com/category/tablets/index.rss')
74    ]
75
76