#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2011, bakthariq AT gmail.com'
'''
m.mediaindonesia.com
'''

from calibre.web.feeds.recipes import BasicNewsRecipe


class Media(BasicNewsRecipe):
    title = 'Media Indonesia'
    __author__ = 'bakthariq'
    oldest_article = 1
    max_articles_per_feed = 500
    timefmt = ' [%a, %b %d, %Y]'
    language = 'id'
    category = 'News, Indonesia'
    publisher = 'Media Indonesia'
    encoding = 'utf-8'
    no_stylesheets = True
    description = 'Indonesian Media Indonesia newsportal'
    cover_url = 'http://m.mediaindonesia.com/public/img/logo.gif'
    no_javascript = True

    remove_tags = [dict(id=['atas', 'merah', 'putih']), dict(name='a')]
    remove_tags_after = [dict(id='putih')]

    extra_css = '''
                            .judul {font-size: x-large;}
                            .tgl {font-size: x-small;color:#333333;}
                            .foto {font-size: x-small;}
    '''

    feeds = [
        ('Polhukam', 'http://www.mediaindonesia.com/rss/1/polhukam'),
        ('Ekonomi dan Bisnis', 'http://www.mediaindonesia.com/rss/2/ekonomi-dan-bisnis'),
        ('Internasional', 'http://www.mediaindonesia.com/rss/6/internasional'),
        ('Olahraga', 'http://www.mediaindonesia.com/rss/3/olahraga'),
        ('Sepakbola', 'http://www.mediaindonesia.com/rss/4/sepakbola'),
        ('Megapolitan', 'http://www.mediaindonesia.com/rss/5/megapolitan'),
        ('Sains dan Teknologi', 'http://www.mediaindonesia.com/rss/7/sains-dan-teknologi'),
        ('Humaniora', 'http://www.mediaindonesia.com/rss/14/humaniora'),
        ('Hiburan', 'http://www.mediaindonesia.com/rss/10/hiburan'),
        ('Opini', 'http://www.mediaindonesia.com/rss/11/opini'),
    ]
