home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / jpost_fr.recipe < prev    next >
Text File  |  2011-09-09  |  3KB  |  58 lines

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class JerusalemPost(BasicNewsRecipe):
  4.     title = 'Jerusalem post'
  5.     language = 'fr'
  6.     __author__ = 'TonytheBookworm'
  7.     description = 'The Jerusalem Post (in French)'
  8.     publisher = 'jpost'
  9.     category = 'news'
  10.     oldest_article = 30
  11.     max_articles_per_feed = 100
  12.     linearize_tables = True
  13.     no_stylesheets = True
  14.     remove_javascript   = True
  15.  
  16.     masthead_url = 'http://static.jpost.com/JPSITES/images/JFrench/2008/site/jplogo.JFrench.gif'
  17.  
  18.     remove_tags = [
  19.                    dict(name='a', attrs={'href':['javascript:window.print()']}),
  20.                    dict(name='div', attrs={'class':['bot']}),
  21.  
  22.                    ]
  23.  
  24.     feeds          = [
  25.                       ('NEWS', 'http://fr.jpost.com/servlet/Satellite?collId=1216805762036&pagename=JFrench%2FPage%2FRSS'),
  26.                       ('JFrench En route vers la paix', 'http://fr.jpost.com/servlet/Satellite?collId=1216805762201&pagename=JFrench%2FPage%2FRSS'),
  27.                       ('JFrench Politique', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737334&pagename=JFrench%2FPage%2FRSS'),
  28.                       ('JFrench Securite', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737338&pagename=JFrench%2FPage%2FRSS'),
  29.                       ('JFrench Moyen Orient', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737342&pagename=JFrench%2FPage%2FRSS'),
  30.                       ('JFrench Diplomatie / Monde', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737346&pagename=JFrench%2FPage%2FRSS'),
  31.                       ('JFrench Economie / Sciences', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737358&pagename=JFrench%2FPage%2FRSS'),
  32.                       ('JFrench Societe', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737354&pagename=JFrench%2FPage%2FRSS'),
  33.                       ('JFrench Opinions', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737350&pagename=JFrench%2FPage%2FRSS'),
  34.                       ('JFrench Monde juif', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737366&pagename=JFrench%2FPage%2FRSS'),
  35.                       ('JFrench Culture / Sport', 'http://fr.jpost.com/servlet/Satellite?collId=1215356737362&pagename=JFrench%2FPage%2FRSS')
  36.                     ]
  37.     def print_version(self, url):
  38.         split1 = url.split("cid=")
  39.         #for testing only -------
  40.         #print 'SPLIT IS: ', split1
  41.         #print 'ORG URL IS: ', url
  42.         #---------------------------
  43.         idnum = split1[1] # get the actual value of the id article
  44.         #for testing only --------------------
  45.         #print 'the idnum is: ', idnum
  46.         #--------------------------------------
  47.         print_url = 'http://fr.jpost.com/servlet/Satellite?cid=' + idnum + '&pagename=JFrench%2FJPArticle%2FPrinter'
  48.         #for testing only -------------------------
  49.         #print 'PRINT URL IS: ', print_url
  50.         #------------------------------------------
  51.         return print_url
  52.  
  53.     #example of how links should be formated
  54.     #--------------------------------------------------------------------------------------------------------------
  55.     #org   version =  http://fr.jpost.com/servlet/Satellite?pagename=JFrench/JPArticle/ShowFull&cid=1282804806075
  56.     #print version =  http://fr.jpost.com/servlet/Satellite?cid=1282804806075&pagename=JFrench%2FJPArticle%2FPrinter
  57.     #------------------------------------------------------------------------------------------------------------------
  58.