Update livemint

This commit is contained in:
unkn0w7n 2024-05-30 17:55:39 +05:30
parent 0b5b93bcfe
commit 1239a405bc
2 changed files with 2 additions and 4 deletions

View File

@ -169,8 +169,6 @@ class Espresso(BasicNewsRecipe):
return ans
def parse_index(self):
# return self.economist_test_article()
# url = 'https://www.economist.com/weeklyedition/archive'
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
'operationName': 'EspressoQuery',
@ -196,7 +194,7 @@ class Espresso(BasicNewsRecipe):
pt.close()
url = 'file:///' + pt.name
ans.append({"title": title, "url": url})
return [('The world in brief', ans)]
return [('Espresso', ans)]
def populate_article_metadata(self, article, soup, first):
article.url = soup.find('h1')['title']

View File

@ -94,7 +94,7 @@ class LiveMint(BasicNewsRecipe):
'''
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')
]
remove_tags = [