diff --git a/recipes/national_geographic_mag.recipe b/recipes/national_geographic_mag.recipe deleted file mode 100644 index 5b43e8b4a9..0000000000 --- a/recipes/national_geographic_mag.recipe +++ /dev/null @@ -1,52 +0,0 @@ -from calibre.web.feeds.recipes import BasicNewsRecipe - -class NGM(BasicNewsRecipe): - - title = 'National Geographic Magazine' - __author__ = 'Krittika Goyal' - description = 'National Geographic Magazine' - timefmt = ' [%d %b, %Y]' - language = 'en' - - no_stylesheets = True - auto_cleanup = True - auto_cleanup_keep = '//div[@class="featurepic"]' - - def nejm_get_index(self): - soup = self.index_to_soup('http://ngm.nationalgeographic.com/') - a = soup.find('div', id='current_issue').find('a', href=True) - return self.index_to_soup('http://ngm.nationalgeographic.com' + a['href']) - - # To parse artice toc - def parse_index(self): - soup = self.nejm_get_index() - tocfull = soup.find('div', attrs={'class':'coltoc'}) - - toc = tocfull.find('div', attrs={'class':'more_section'}) - - articles = [] - feeds = [] - section_title = 'Features' - for x in toc.findAll(True): - if x.name == 'a': - # Article found - title = self.tag_to_string(x) - url = x.get('href', False) - if not url or not title: - continue - url = 'http://ngm.nationalgeographic.com' + url - self.log('\t\tFound article:', title) - self.log('\t\t\t', url) - articles.append({'title': title, 'url':url, - 'description':'', 'date':''}) - feeds.append((section_title, articles)) - - art1 = tocfull.findAll('a')[1] - art1_title = self.tag_to_string(art1.find('div', attrs={'class': 'toched'})) - art1_url = art1.get('href', False) - art1_url = 'http://ngm.nationalgeographic.com' + art1_url - art1feed = {'title': art1_title, 'url':art1_url, - 'description':'', 'date':''} - feeds.append(('Cover Story', [art1feed])) - - return feeds diff --git a/recipes/nationalgeographic.recipe b/recipes/nationalgeographic.recipe deleted file mode 100644 index f47f973f49..0000000000 --- a/recipes/nationalgeographic.recipe +++ /dev/null @@ -1,33 +0,0 @@ -__license__ = 'GPL v3' -__copyright__ = '2010, Hiroshi Miura ' -''' -nationalgeographic.com -''' - -from calibre.web.feeds.news import BasicNewsRecipe -import re - -class NationalGeographicNews(BasicNewsRecipe): - title = u'National Geographic News' - oldest_article = 7 - language = 'en' - max_articles_per_feed = 100 - remove_javascript = True - no_stylesheets = True - use_embedded_content = False - auto_cleanup = True - - feeds = [(u'news', u'http://feeds.nationalgeographic.com/ng/News/News_Main')] - - def parse_feeds(self): - feeds = BasicNewsRecipe.parse_feeds(self) - for curfeed in feeds: - delList = [] - for a,curarticle in enumerate(curfeed.articles): - if re.search(r'ads\.pheedo\.com', curarticle.url): - delList.append(curarticle) - if len(delList)>0: - for d in delList: - index = curfeed.articles.index(d) - curfeed.articles[index:index+1] = [] - return feeds