From 69f332197220d83947c8f4a8621cd7e849edfb45 Mon Sep 17 00:00:00 2001 From: houfu Date: Tue, 3 Sep 2024 18:56:10 +0800 Subject: [PATCH] Bug fix: When Monday falls at the beginning of the month, script fails to get any articles due to month change Add 2 Sept 2024 (manual) Add 3 September 2024 (Manual) --- sg_law_cookies/main.py | 32 +++++++++----------- site/content/post/02-September-2024.md | 36 ++++++++++++++++++++++ site/content/post/03-September-2024.md | 42 ++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 17 deletions(-) create mode 100644 site/content/post/02-September-2024.md create mode 100644 site/content/post/03-September-2024.md diff --git a/sg_law_cookies/main.py b/sg_law_cookies/main.py index 3adbccd..ba03bf6 100644 --- a/sg_law_cookies/main.py +++ b/sg_law_cookies/main.py @@ -37,7 +37,7 @@ class NewsArticle(BaseModel): title: str source_link: AnyHttpUrl author: str - date: datetime.datetime + date: datetime.date summary: str text: str @@ -47,7 +47,7 @@ class ScrapedArticle: title: str source_link: AnyHttpUrl author: str - date: datetime.datetime + date: datetime.date @classmethod def from_article(cls, article): @@ -58,7 +58,7 @@ def from_article(cls, article): self.author = article.author.text self.date = datetime.datetime.strptime( article.pubDate.text, "%d %b %Y %H:%M:%S" - ) + ).date() return self @@ -75,7 +75,8 @@ def check_if_article_should_be_included( Checks if an article should be included in the list to be processed by: * Removing articles which are advertisements - * Removing articles which are in the past (i.e. not today). If it is a weekend today, return Friday's articles. + * Removing articles which are in the past (i.e. not today). + If it is a Monday today, return Saturday and Sunday's articles. :param scrape_date: :param article: @@ -86,19 +87,16 @@ def check_if_article_should_be_included( if article.title.startswith("ADV: "): return False today = scrape_date - if today.weekday() == 0: - saturday = today - datetime.timedelta(days=2) - return ( - article.date.year == saturday.year - and article.date.day >= saturday.day - and article.date.month == saturday.month - ) - else: - return ( - article.date.year == today.year - and article.date.day == today.day - and article.date.month == today.month - ) + filter = ( + [ + today - datetime.timedelta(days=2), # Saturday + today - datetime.timedelta(days=1), # Sunday + today, # Monday + ] + if today.weekday() == 0 + else [today] + ) + return article.date in filter def scrape_news_articles_today(scrape_date: datetime.date) -> list[ScrapedArticle]: diff --git a/site/content/post/02-September-2024.md b/site/content/post/02-September-2024.md new file mode 100644 index 0000000..7db94f2 --- /dev/null +++ b/site/content/post/02-September-2024.md @@ -0,0 +1,36 @@ +--- +title: SG Law Cookies (02 September 2024) +date: 2024-09-02 00:00:00 +0800 +description: SG Law Cookies, an algorithmically produced digest of legal news in Singapore, for 02 September 2024 +summary: | + In courtrooms where justice seeks its voice, + Bankrupt dreams and shophouse choice, + Victims' truths in cross-examined light, + Lawyers' duty to uphold the right. + Financial prudence, consent's clear call, + In legal battles, fairness stands tall. +--- + +Hello, this is Your Amicus, your friendly little legal bot from the little island of Singapore. + +Here's a summary of today's post, in the form of a short poem: + +In courtrooms where justice seeks its voice, +Bankrupt dreams and shophouse choice, +Victims' truths in cross-examined light, +Lawyers' duty to uphold the right. +Financial prudence, consent's clear call, +In legal battles, fairness stands tall. + +## Here are some news articles from the Singapore Law Watch. + + +The article discusses the legal nuances surrounding the defense strategies employed in sexual assault cases, particularly regarding the treatment of victims during cross-examination. It emphasizes that lawyers must avoid shaming victims and focus on the relevance of questions, as established by recent court rulings. Notably, the High Court clarified that inquiries about a victim's clothing are permissible only if they directly relate to the offense's context, not to imply blame. + +Key precedents are highlighted, such as the 2012 amendments to the Evidence (Amendment) Bill, which reinforced the principle that a victim's character or sexual history is generally irrelevant. The takeaway is that attorneys can robustly defend their clients while maintaining respect for victims, ensuring that all questioning aligns with legal relevance. \[[link](https://www.singaporelawwatch.sg/Headlines/Lawyers-say-accusers-must-not-be-shamed-when-defending-clients-in-sexual-assault-cases)\] + +The article discusses a notable increase in bankruptcy filings in Singapore, with 2,334 individuals filing in the first half of 2024, marking a 25% rise from the previous year. Legal implications include a strict bankruptcy regime with a focus on rehabilitation, introduced through reforms in 2016, allowing first-time bankrupts to discharge their debts within three to seven years. Key points include the Debt Repayment Scheme (DRS), which offers a more manageable repayment plan but requires specific eligibility criteria. The article emphasizes proactive financial management to avoid bankruptcy and potential restrictions on employment and travel for declared bankrupts. + +In conclusion, effective financial prudence is crucial to prevent the stigma and limitations associated with bankruptcy. \[[link](https://www.singaporelawwatch.sg/Headlines/More-people-declared-bankrupt-in-1st-half-of-2024-number-of-undischarged-bankrupts-up)\] + +An 84-year-old woman, Madam Ho Dat Khoon, successfully regained ownership of a $7.8 million shophouse after the High Court ruled the 2016 transfer to her grandniece was invalid due to her lack of understanding of the transaction's implications. The court expressed concern over the conduct of her lawyer, David Liew, referring him to the Law Society of Singapore for failing to act in Madam Ho's best interest and not properly confirming her instructions. This case underscores the critical importance of ensuring informed consent and the lawyer's role in safeguarding clients against potential exploitation. \[[link](https://www.singaporelawwatch.sg/Headlines/Elderly-woman-wins-case-to-cancel-transfer-of-78m-shophouse-lawyers-conduct-under-scrutiny)\] diff --git a/site/content/post/03-September-2024.md b/site/content/post/03-September-2024.md new file mode 100644 index 0000000..cb38588 --- /dev/null +++ b/site/content/post/03-September-2024.md @@ -0,0 +1,42 @@ +--- +title: SG Law Cookies (03 September 2024) +date: 2024-09-03 13:40:48 +0800 +description: SG Law Cookies, an algorithmically produced digest of legal news in Singapore, for 03 September 2024 +summary: | + "Legal battles brew, in boardrooms and courts unfurled,
+ In Singapore's realm, where justice whirls.
+ From transport ministers to corporate forts,
+ To tragic fires where safety falls short.
+ In each tale, a lesson learned,
+ In the dance of law, the world turns." +--- + +Hello, this is Your Amicus, your friendly little legal bot from the little island of Singapore. + +Here's a summary of today's post, in the form of a short poem: + +"Legal battles brew, in boardrooms and courts unfurled,
+In Singapore's realm, where justice whirls.
+From transport ministers to corporate forts,
+To tragic fires where safety falls short.
+In each tale, a lesson learned,
+In the dance of law, the world turns." + +## Here are some news articles from the Singapore Law Watch. + + +The article discusses former Singapore Transport Minister S. Iswaran's ongoing legal challenges as he prepares for trial, specifically his third attempt to obtain conditioned statements from prosecution witnesses. Iswaran is seeking to file a criminal reference with the Court of Appeal to clarify whether witness statements should be included in the prosecution's disclosure obligations, a question he argues is of public interest. + +His legal team contends that under the Criminal Procedure Code (CPC), the prosecution must disclose all witness statements it intends to call, while the prosecution asserts it is only required to disclose statements it plans to admit at trial, having indicated it does not intend to introduce any conditioned statements. Previous attempts to secure these statements have been dismissed by the courts, with Justice Vincent Hoong affirming the prosecution's interpretation of the CPC as "clear and unambiguous." + +In conclusion, Iswaran's case raises significant questions about the scope of disclosure obligations in criminal proceedings, which could have broader implications for similar cases in the future. \[[link](https://www.singaporelawwatch.sg/Headlines/Former-transport-minister-Iswaran-makes-third-bid-for-statements-of-trial-witnesses)\] + +A significant legal dispute has arisen over the control of Tipsy Collective, a hospitality group in Singapore, following the death of co-founder Derek Ong. David Gan Jia Liang, the other co-founder, has initiated a lawsuit against eight parties, including Indonesian investors, alleging attempts to unlawfully oust him from his directorial position. The core legal issue revolves around a shareholders' agreement that Gan claims protects his rights, particularly concerning board composition and decision-making authority, which the Indonesian shareholders dispute in light of their increased ownership post-Ong’s death. + +Gan's request for an interim injunction aims to maintain the current management structure and prevent any actions that could undermine his control until the case is resolved. The implications of this case could set important precedents regarding shareholder rights and the interpretation of corporate governance agreements, especially in the context of significant ownership changes following a co-founder's death. A court conference to discuss the next steps is scheduled for September 11. + +In conclusion, this case underscores the complexities of corporate governance in the wake of leadership transitions and highlights the critical importance of establishing clear shareholder agreements to mitigate disputes. \[[link](https://www.singaporelawwatch.sg/Headlines/Legal-battle-emerges-for-control-of-home-grown-Tipsy-Collective-hospitality-group)\] + +The article discusses the ongoing coroner's inquiry into a fatal industrial fire in Tuas, Singapore, which resulted in the death of an employee, Manku Suri Appa Rao, due to an explosion caused by a build-up of acetylene gas. The Ministry of Manpower (MOM) is contemplating legal actions against parties involved, pending assessments of workplace safety violations, particularly related to inadequate ventilation and lack of gas detection systems. Key testimonies revealed that poor safety practices, such as inadequate electrical checks and improper procedures for checking gas cylinders, likely contributed to the incident. Notably, the absence of structured training and designated responsibilities for safety checks raises significant concerns about compliance with occupational health standards. The outcome of the inquiry and potential repercussions for Asia Technical Gas could set important precedents for workplace safety regulations in Singapore. + +In conclusion, this case highlights critical deficiencies in safety protocols and training that may lead to legal accountability, emphasizing the importance of rigorous adherence to occupational health and safety standards to prevent future tragedies. \[[link](https://www.singaporelawwatch.sg/Headlines/MOM-to-consider-taking-action-against-those-involved-in-2022-Tuas-industrial-fire-coroners-court-hears)\]