#!/usr/bin/env  python2

__license__ = 'GPL v3'
__copyright__ = '2009, Rick Kellogg'
'''
Infoworld.com
'''

from calibre.web.feeds.news import BasicNewsRecipe
from bs4 import Tag

class Infoworld(BasicNewsRecipe):
    title = u'Infoworld.com'
    __author__ = 'Rick Kellogg'
    description = 'news'
    language = 'en'
    oldest_article = 3
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    auto_cleanup = True

    feeds = [(u'Top Tech Stories', u'http://www.infoworld.com/index.rss'),
             (u'Today\'s Tech Headlines',
              u'http://www.infoworld.com/news/index.rss')]

    def preprocess_html(self, soup):
        for aside in soup.find(attrs={'class': 'fakesidebar'}):  # type: Tag
            aside.extract()

        return soup

    def postprocess_html(self, soup, first_fetch):
        print soup.prettify()
        return soup
