View Single Post
Old 11-11-2015, 12:25 PM   #9
tom_a_sparks
Member
tom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheesetom_a_sparks can extract oil from cheese
 
Posts: 21
Karma: 1010
Join Date: Dec 2011
Device: sony reader PRS-T1, kobo touch
I was running an older version and save the edits to the newer file and wounding why nothing was changing, D'oh!

Code:
__license__   = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
gamasutra.com
'''
import re
from calibre.web.feeds.news import BasicNewsRecipe

class Gamasutra(BasicNewsRecipe):
    title                 = 'Gamasutra Featured articles'
    __author__            = 'Darko Miletic'
    description           = 'The Art and Business of Making Games'
    publisher             = 'Gamasutra'
    category              = 'news, games, IT'
    oldest_article        = 2
    max_articles_per_feed = 200
    no_stylesheets        = True
    encoding              = 'cp1252'
    use_embedded_content  = False
    language              = 'en'
    remove_empty_feeds    = True
    masthead_url          = 'http://www.gamasutra.com/images/gamasutra_logo.gif'

    conversion_options = {
                          'comment'          : description
                        , 'tags'             : category
                        , 'publisher'        : publisher
                        , 'language'         : language
                        , 'linearize_tables' : True
                        }

    remove_tags_before = dict(name="div",attrs={'class':'page_item'})
    remove_tags       = [
                          dict(name='meta')
                         ,dict(name='link')
                         ,dict(name='hr')
                         ,dict(name='div', attrs={'class':'hide-phone'})
                         ,dict(name='div', attrs={'class':'nav_links'})
                         ,dict(name='div', attrs={'class':'superfooter'})
,dict(name='span', attrs={'class':'comment_text'})
,dict(name='a', attrs={'type':'button'})
                         ]
    remove_attributes = ['width','height','name']


    feeds = [(u'Feature Articles', u'http://feeds.feedburner.com/GamasutraFeatureArticles')]



    def print_version(self, url):
        if (url.find("?page=1") != -1):
            temp_url = url.replace("?page=1", "")
        else:
            temp_url = url
        # Always add "?print=true" to the end of the url.
        print_url = temp_url + "?print=1"

        return print_url
tom_a_sparks is offline   Reply With Quote