mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-31 10:37:00 -04:00 
			
		
		
		
	Update livemint
This commit is contained in:
		
							parent
							
								
									0b5b93bcfe
								
							
						
					
					
						commit
						1239a405bc
					
				| @ -169,8 +169,6 @@ class Espresso(BasicNewsRecipe): | |||||||
|         return ans |         return ans | ||||||
| 
 | 
 | ||||||
|     def parse_index(self): |     def parse_index(self): | ||||||
| 		# return self.economist_test_article() |  | ||||||
| 		# url = 'https://www.economist.com/weeklyedition/archive' |  | ||||||
|         query = { |         query = { | ||||||
|             'query': 'query EspressoQuery($ref:String!){espresso:canonical(ref:$ref){...EspressoFragment __typename}}fragment EspressoFragment on Content{id type hasPart(size:1 sort:"datePublished:desc"){parts{id type rubric:description hasPart(sort:"publication.context.position:asc,datePublished:desc"){parts{...ArticleFragment __typename}__typename}__typename}__typename}__typename}fragment ArticleFragment on Content{ad{grapeshot{channels{name __typename}__typename}__typename}articleSection{internal{id title:headline __typename}__typename}audio{main{id duration(format:"seconds")source:channel{id __typename}url{canonical __typename}__typename}__typename}byline dateline dateModified datePublished dateRevised flyTitle:subheadline id image{...ImageInlineFragment ...ImageMainFragment ...ImagePromoFragment __typename}print{title:headline flyTitle:subheadline rubric:description section{id title:headline __typename}__typename}publication{id tegID title:headline flyTitle:subheadline datePublished regionsAllowed url{canonical __typename}__typename}rubric:description source:channel{id __typename}tegID text(format:"json")title:headline type url{canonical __typename}topic contentIdentity{forceAppWebview mediaType articleType __typename}__typename}fragment ImageInlineFragment on Media{inline{url{canonical __typename}width height __typename}__typename}fragment ImageMainFragment on Media{main{url{canonical __typename}width height __typename}__typename}fragment ImagePromoFragment on Media{promo{url{canonical __typename}id width height __typename}__typename}',  # noqa |             'query': 'query EspressoQuery($ref:String!){espresso:canonical(ref:$ref){...EspressoFragment __typename}}fragment EspressoFragment on Content{id type hasPart(size:1 sort:"datePublished:desc"){parts{id type rubric:description hasPart(sort:"publication.context.position:asc,datePublished:desc"){parts{...ArticleFragment __typename}__typename}__typename}__typename}__typename}fragment ArticleFragment on Content{ad{grapeshot{channels{name __typename}__typename}__typename}articleSection{internal{id title:headline __typename}__typename}audio{main{id duration(format:"seconds")source:channel{id __typename}url{canonical __typename}__typename}__typename}byline dateline dateModified datePublished dateRevised flyTitle:subheadline id image{...ImageInlineFragment ...ImageMainFragment ...ImagePromoFragment __typename}print{title:headline flyTitle:subheadline rubric:description section{id title:headline __typename}__typename}publication{id tegID title:headline flyTitle:subheadline datePublished regionsAllowed url{canonical __typename}__typename}rubric:description source:channel{id __typename}tegID text(format:"json")title:headline type url{canonical __typename}topic contentIdentity{forceAppWebview mediaType articleType __typename}__typename}fragment ImageInlineFragment on Media{inline{url{canonical __typename}width height __typename}__typename}fragment ImageMainFragment on Media{main{url{canonical __typename}width height __typename}__typename}fragment ImagePromoFragment on Media{promo{url{canonical __typename}id width height __typename}__typename}',  # noqa | ||||||
|             'operationName': 'EspressoQuery', |             'operationName': 'EspressoQuery', | ||||||
| @ -196,7 +194,7 @@ class Espresso(BasicNewsRecipe): | |||||||
|             pt.close() |             pt.close() | ||||||
|             url = 'file:///' + pt.name |             url = 'file:///' + pt.name | ||||||
|             ans.append({"title": title, "url": url}) |             ans.append({"title": title, "url": url}) | ||||||
|         return [('The world in brief', ans)] |         return [('Espresso', ans)] | ||||||
| 
 | 
 | ||||||
|     def populate_article_metadata(self, article, soup, first): |     def populate_article_metadata(self, article, soup, first): | ||||||
|         article.url = soup.find('h1')['title'] |         article.url = soup.find('h1')['title'] | ||||||
|  | |||||||
| @ -94,7 +94,7 @@ class LiveMint(BasicNewsRecipe): | |||||||
|         ''' |         ''' | ||||||
| 
 | 
 | ||||||
|         keep_only_tags = [ |         keep_only_tags = [ | ||||||
|             dict(name='article', attrs={'id':lambda x: x and x.startswith(('article_', 'box_'))}), |             dict(name='article', attrs={'id':lambda x: x and x.startswith(('article_', 'box_', 'storyPage_storyBox__'))}), | ||||||
|             classes('contentSec') |             classes('contentSec') | ||||||
|         ] |         ] | ||||||
|         remove_tags = [ |         remove_tags = [ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user