#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement

__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net> edited by Huan T'

from calibre.web.feeds.news import BasicNewsRecipe


class Slashdot(BasicNewsRecipe):
    title = 'Slashdot.org'
    description = '''Tech news. WARNING: This recipe downloads a lot
    of content and may result in your IP being banned from slashdot.org'''
    oldest_article = 7
    simultaneous_downloads = 1
    delay = 3
    max_articles_per_feed = 100
    language = 'en'

    __author__ = 'floweros edited by Huan T'
    no_stylesheets = True
    use_embedded_content = False
    keep_only_tags = [
        dict(name='div', attrs={'class': 'story'}),
        dict(name='div', attrs={'class': 'body'}),
        dict(name='ul', attrs={'id': 'commentlisting'}),
    ]

    feeds = [
        ('Slashdot', 'http://rss.slashdot.org/Slashdot/slashdot'),
        ('/. IT', 'http://rss.slashdot.org/Slashdot/slashdotIT'),
        ('/. Hardware', 'http://rss.slashdot.org/Slashdot/slashdotHardware'),
        ('/. Linux', 'http://rss.slashdot.org/Slashdot/slashdotLinux'),
        ('/. Your Rights Online', 'http://rss.slashdot.org/Slashdot/slashdotYourRightsOnline'),
    ]
