Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TheTelegraph #616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/fundus/publishers/uk/the_telegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

class TheTelegraphParser(ParserProxy):
class V1(BaseParser):
VALID_UNTIL = datetime.date(2024, 9, 9)
_paragraph_selector = CSSSelector("div.articleBodyText p")
_subheadline_selector = CSSSelector("div.articleBodyText h2")
_summary_selector = CSSSelector("p[itemprop='description']")
Expand Down Expand Up @@ -47,3 +48,10 @@ def title(self) -> Optional[str]:
@attribute
def topics(self) -> List[str]:
return generic_topic_parsing(self.precomputed.meta.get("keywords"))

class V1_1(V1):
VALID_UNTIL = datetime.date.today()

@attribute
def publishing_date(self) -> Optional[datetime.datetime]:
return generic_date_parsing(self.precomputed.ld.bf_search("datePublished"))
60 changes: 60 additions & 0 deletions tests/resources/parser/test_data/uk/TheTelegraph.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,65 @@
"Home",
"How to Save Money"
]
},
"V1_1": {
"authors": [
"Amy Gibbons"
],
"body": {
"summary": [
"PM suggests he will continue to accept donations from peer and prominent party donor who was given pass to access Downing Street"
],
"sections": [
{
"headline": [],
"paragraphs": [
"Sir Keir Starmer has defended accepting gifts from a millionaire Labour donor who was later given a pass to access No 10 Downing Street.",
"The Prime Minister suggested he would continue to take gifts from Lord Alli, despite a row over some of his donations not being declared in line with parliamentary rules.",
"The Labour peer has given Sir Keir tens of thousands of pounds to spend on suits and spectacles, and over the weekend it emerged that Lady Starmer, the Prime Minister’s wife, had also been given £5,000 worth of clothes and personal shopping.",
"Asked on Monday whether he would continue to accept gifts from Lord Alli, Sir Keir said that “all Members of Parliament get gifts” and “the important thing is that they’re declared in accordance with the rules”.",
"It can also be revealed that the Labour peer lent the Starmers his house at times during the election, as part of accommodation worth more than £20,000.",
"On Monday, Lady Starmer attended Edeline Lee’s London Fashion Week show in an outfit lent to her by the designer.",
"It came a day after it emerged that Sir Keir had initially failed to declare the £5,000 of donations covering the cost of his wife’s personal shopper, clothes and alterations.",
"MPs are supposed to declare gifts and donations to the parliamentary authorities within 28 days of receiving them. They have to declare “any interest which someone might reasonably consider to influence their actions or words as an MP”, and the declarations are then published on the Register of Members’ Financial Interests.",
"However, the Prime Minister declared the gifts to his wife, thought to have been received both before and after he entered Downing Street, only last week after initially believing that they did not need to be added to the register.",
"On Monday night No 10 confirmed the Standards Commissioner declined to carry out an investigation into Sir Keir’s failure to declare donations from Lord Alli, following calls from the Tories.",
"A Tory source said: “It’s shocking that Lady Starmer thought it acceptable to strut her way through London Fashion Week adorned in free designer swag the day after it was revealed Keir Starmer had failed to declare donations for clothing gifted to his wife.”",
"Lady Starmer is one of several wives of prime ministers to have worn clothes by British designers to showcase the country’s fashion industry. She has repeatedly worn dresses by the British brand Me+Em.",
"Lord Alli provided the Labour leader with accommodation worth more than £20,000 from 29 May, the week after the election was called, to 13 July, a week after Labour’s landslide victory.",
"He was at Lord Alli’s house on the night of the election – July 4 – to see the exit poll and watch early results come in, before going to his constituency count at Camden town hall, north London.",
"The revelation shows the strength of the relationship between Lord Alli and the Prime Minister. He is Sir Keir’s biggest personal donor and has given nearly £1 million to the Labour Party and its politicians over the past 20 years.",
"On Monday, Sir Keir dodged several questions on whether he would continue taking handouts from Lord Alli, pledging only to “comply with the rules”.",
"He said it would be “pushing it a bit far” to deny him the right to accept Arsenal tickets, as he could not sit in his usual seat for security reasons.",
"Sir Keir accepted more than 20 free tickets to football matches in the last Parliament, according to figures released in July, using complimentary seats to watch Arsenal play Manchester United, Manchester City and Porto.",
"He was pictured with David Lammy, the Foreign Secretary, at Sunday’s north London derby against Tottenham. Mr Lammy, the MP for Tottenham, posted a photo of the pair at the match on X, formerly Twitter.",
"Sir Keir said on Monday: “All Members of Parliament get gifts. The rules then say that over a certain value you’ve got to declare the gifts, so everybody can see what it was, how much it was, who it came from, and so that you and others can ask questions about it. That’s a good framework. It’s the right framework.”",
"Asked whether he thought he had done nothing wrong, and whether he would continue taking those sorts of donations, he said: “The problem is, let’s take football as an example. I’m a massive Arsenal fan. I can’t go into the stands because of security reasons. Therefore if I don’t accept a gift of hospitality I can’t go to a game.",
"“You could say, well, bad luck. That’s why gifts have to be registered. But you know, never going to an Arsenal game again because I can’t accept hospitality is pushing it a bit far.”",
"Asked again whether he would continue to accept gifts from Lord Alli, he said: “Well, wherever there are gifts from anyone I’m going to comply with the rules… Look, there are gifts to all MPs of different sizes and shapes. The important thing is that they’re declared in accordance with the rules.”",
"Asked whether an anti-corruption advisor would be appointed, he went on: “Well, there’s a massive difference between declarations and corruption. Declarations are about declaring properly so that you and others can see properly made declarations.”",
"On Sunday, Mr Lammy said the Prime Minister and his wife had accepted the donations so they could “look their best” to represent the UK, adding that the US had a “huge budget from the taxpayer” to clothe its leaders.",
"Asked on Monday why he did not buy his own clothes and what he made of Mr Lammy’s comments, Sir Keir said: “I certainly don’t think we should have a budget for it at the taxpayers’ expense, in relation to gifts of any sort.”",
"The Conservatives’ letter to Daniel Greenberg, the standards commissioner, said: “In August it was reported that Lord Alli had been given a temporary Downing Street security pass despite having no formal government role. It was reported that he had played an active role in selecting Cabinet (and other) appointments.",
"“It has now emerged that at the same time Sir Keir Starmer failed to declare a substantial gift of designer clothes, tailoring and a personal shopper bought for his wife by Lord Alli, both prior to the general election on July 4 2024 and following it.”",
"The letter also said that “there must be a full investigation into this scandal, given that this is not the first instance of the Prime Minister failing to declare donations and abiding by parliamentary rules.”",
"On Monday night, Number 10 said the parliamentary commissioner for standards had said there would be no investigation into late declarations."
]
}
]
},
"publishing_date": "2024-09-16 21:33:00+01:00",
"title": "Starmer defiant over taking gifts from Lord Alli",
"topics": [
"Labour Party",
"UK News",
"Politics",
"Standard",
"News",
"US content",
"Keir Starmer",
"Conservative Party",
"David Lammy"
]
}
}
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/resources/parser/test_data/uk/meta.info
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"url": "https://www.telegraph.co.uk/recommended/home/best-heated-clothes-airer/",
"crawl_date": "2023-08-30 17:51:33.803288"
},
"TheTelegraph_2024_09_17.html.gz": {
"url": "https://www.telegraph.co.uk/politics/2024/09/16/keir-victoria-starmer-clothes-row-lord-alli/",
"crawl_date": "2024-09-17 08:57:08.041442"
},
"iNews_2023_08_30.html.gz": {
"url": "https://inews.co.uk/sport/tennis/us-open-2023-british-players-results-andy-murray-katie-boulter-cam-norrie-evans-burrage-draper-2580837",
"crawl_date": "2023-08-30 18:39:34.320432"
Expand Down