Skip to content

Commit

Permalink
Bug fix: Inconsistent datetime and date objects
Browse files Browse the repository at this point in the history
Add 4 September 2024 (Manual)
  • Loading branch information
houfu committed Sep 4, 2024
1 parent 69f3321 commit f04fcd4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sg_law_cookies/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def check_if_article_should_be_included(
if article.title.startswith("ADV: "):
return False
today = scrape_date
filter = (
date_filter = (
[
today - datetime.timedelta(days=2), # Saturday
today - datetime.timedelta(days=1), # Sunday
Expand All @@ -96,7 +96,7 @@ def check_if_article_should_be_included(
if today.weekday() == 0
else [today]
)
return article.date in filter
return article.date in date_filter


def scrape_news_articles_today(scrape_date: datetime.date) -> list[ScrapedArticle]:
Expand All @@ -114,11 +114,9 @@ def scrape_news_articles_today(scrape_date: datetime.date) -> list[ScrapedArticl
ScrapedArticle.from_article(article) for article in soup.find_all("item")
]

return [
article
for article in news_articles
if check_if_article_should_be_included(article, scrape_date)
]
result = [article for article in news_articles if check_if_article_should_be_included(article, scrape_date)]
print(f"No of articles: {len(result)}")
return result


def get_summary(article: ScrapedArticle) -> NewsArticle:
Expand Down Expand Up @@ -203,7 +201,7 @@ def main():
env = Environment(loader=PackageLoader("sg_law_cookies"))
template = env.get_template("template.jinja2")
print("Getting summaries.")
scrape_date = datetime.datetime.today()
scrape_date = datetime.date.today()
summaries, day_summary = get_summaries(scrape_news_articles_today(scrape_date))
if len(summaries) == 0:
raise Exception("No summaries were found.")
Expand Down
38 changes: 38 additions & 0 deletions site/content/post/04-September-2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: SG Law Cookies (04 September 2024)
date: 2024-09-04 00:00:00 +0800
description: SG Law Cookies, an algorithmically produced digest of legal news in Singapore, for 04 September 2024
summary: |
In courts where justice shields the young,
From fractured homes, their safety sung.
Illegal rides through borders weave,
Where laws and risks in shadows cleave.
Reforms and rules in balance sway,
To guard the paths where children play.
---

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 courts where justice shields the young,
From fractured homes, their safety sung.
Illegal rides through borders weave,
Where laws and risks in shadows cleave.
Reforms and rules in balance sway,
To guard the paths where children play.

## Here are some news articles from the Singapore Law Watch.


The article discusses significant amendments to the Family Justice Act 2014 in Singapore, aimed at empowering courts to dismiss unmeritorious applications that could harm children's welfare in divorce proceedings. This shift towards a more judge-led approach is designed to minimize conflict and expedite processes. Judges will now have greater discretion to control proceedings, focusing on children's needs and discouraging frivolous applications. Additionally, the new mutual agreement divorce process requires couples to demonstrate reconciliation efforts without assigning fault. Overall, these changes reflect a commitment to therapeutic justice and a more efficient family law system. \[[link](https://www.singaporelawwatch.sg/Headlines/Courts-to-get-more-powers-to-bar-applications-that-hurt-childs-welfare-in-divorce-cases)\]

In a recent ruling, the Singapore High Court upheld a district judge's decision to place a mother’s two daughters in safe custody for 12 months due to exposure to pornography and concerns over their welfare. The court found the mother had neglected her responsibility to protect her children, who exhibited self-harm and violent behaviors. Justice Choo emphasized the mother's failure to reflect on her parenting methods, dismissing her appeal as meritless. This case underscores the critical role of child protection services in safeguarding minors and highlights the legal standards applied under the Children and Young Persons Act.

Key takeaway: Courts prioritize child safety over parental objections when evidence of harm is present. \[[link](https://www.singaporelawwatch.sg/Headlines/Mother-whose-2-daughters-were-exposed-to-porn-under-her-care-loses-High-Court-appeal)\]

The article discusses the rise of unlicensed cross-border chauffeured rides in Singapore, despite them being illegal. Only approved taxis from Singapore and Malaysia are authorized for such services. Many users, like Ms. Kuan, unknowingly utilize these illegal services for convenience, unaware of the associated risks, including lack of insurance coverage and potential legal implications.

The Land Transport Authority (LTA) has ramped up enforcement against illegal operators, leading to fines and vehicle seizures. Experts suggest that regulatory reforms may be necessary to address market demand and make legal services more competitive.

In conclusion, users should be aware of the risks and legal ramifications of using unlicensed transport services, as the landscape is shifting toward potential regulatory changes. \[[link](https://www.singaporelawwatch.sg/Headlines/Illegal-but-in-demand-Why-some-Sporeans-use-unlicensed-cross-border-chauffeured-rides)\]

0 comments on commit f04fcd4

Please sign in to comment.