From 82f7e8f8ccd6a9b825c472f54061c3e774501b92 Mon Sep 17 00:00:00 2001 From: David Slusser Date: Wed, 12 Nov 2025 19:13:03 -0800 Subject: [PATCH 1/2] updating group detail page; fixing regex for meetup event detail ingestion --- .../templates/web/partials/detail/group.htm | 80 ++++++++++--------- .../web/utilities/scrapers/meetup.py | 5 +- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/src/django_project/web/templates/web/partials/detail/group.htm b/src/django_project/web/templates/web/partials/detail/group.htm index 0c54fd5..f6a8ad5 100644 --- a/src/django_project/web/templates/web/partials/detail/group.htm +++ b/src/django_project/web/templates/web/partials/detail/group.htm @@ -5,49 +5,51 @@ -
-
-

About

-
-
-
-
- {% if object.description %} - {{ object.description|safe }} - {% else %} - No description - {% endif %} +
+
+
+

About

+
-
-
- -
-
-
-

Upcoming Events

-
-
- {% with object.get_upcoming_events as queryset %} - {% if queryset %} - {% include "web/partials/li/events.htm" %} +
+
+ {% if object.description %} + {{ object.description|safe }} {% else %} - No upcoming events + No description {% endif %} - {% endwith %}
-
-

Past Events

-
-
- {% with object.get_past_events as queryset %} - {% if queryset %} - {% include "web/partials/li/events.htm" %} - {% else %} - No past events - {% endif %} - {% endwith %} +
+ +
+
+
+

Upcoming Events

+
+
+ {% with object.get_upcoming_events as queryset %} + {% if queryset %} + {% include "web/partials/li/events.htm" %} + {% else %} + No upcoming events + {% endif %} + {% endwith %} +
+
+
+

Past Events

+
+
+ {% with object.get_past_events as queryset %} + {% if queryset %} + {% include "web/partials/li/events.htm" %} + {% else %} + No past events + {% endif %} + {% endwith %} +
- -
\ No newline at end of file + + \ No newline at end of file diff --git a/src/django_project/web/utilities/scrapers/meetup.py b/src/django_project/web/utilities/scrapers/meetup.py index 0162a7b..deee5af 100644 --- a/src/django_project/web/utilities/scrapers/meetup.py +++ b/src/django_project/web/utilities/scrapers/meetup.py @@ -5,6 +5,7 @@ from bs4 import BeautifulSoup, Tag from bs4.element import AttributeValueList, NavigableString, PageElement + from web.utilities.html_utils import fetch_content, fetch_content_with_playwright @@ -65,7 +66,9 @@ def get_event_information(url: str) -> dict: event_info["name"] = soup.find("h1", class_="ds2-b32 text-ds2-text-fill-primary-enabled lg:ds2-b48") if event_info["name"]: event_info["name"] = event_info["name"].text - description_div: PageElement | Tag | NavigableString | None = soup.find("div", class_="break-words") + description_div: PageElement | Tag | NavigableString | None = soup.find( + "div", class_="w-full break-words transition-all duration-300 line-clamp-[15]" + ) if description_div: if isinstance(description_div, Tag): # Type check for Tag event_info["description"] = "".join(str(child) for child in description_div.children) From 727ff386b19a186e72f5ae4d394b86ae601b897c Mon Sep 17 00:00:00 2001 From: David Slusser Date: Wed, 12 Nov 2025 19:31:05 -0800 Subject: [PATCH 2/2] updated isort --- src/django_project/web/utilities/scrapers/meetup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/django_project/web/utilities/scrapers/meetup.py b/src/django_project/web/utilities/scrapers/meetup.py index deee5af..63d6207 100644 --- a/src/django_project/web/utilities/scrapers/meetup.py +++ b/src/django_project/web/utilities/scrapers/meetup.py @@ -5,7 +5,6 @@ from bs4 import BeautifulSoup, Tag from bs4.element import AttributeValueList, NavigableString, PageElement - from web.utilities.html_utils import fetch_content, fetch_content_with_playwright