Skip to content

Commit d971e7e

Browse files
committed
remove old RSS feed code
1 parent 5933041 commit d971e7e

File tree

3 files changed

+2
-66
lines changed

3 files changed

+2
-66
lines changed

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Waterloo, scraped directly from Instagram.
2525
- **Club directory:** Explore all clubs with links to their website/Instagram
2626
- **Email newsletter:** Subscribe to get the latest events in your inbox, once daily
2727

28-
### Environment Setup
28+
## 🏗️ Environment Setup
2929

3030
#### Database
3131
```bash
3232
docker compose up --build
3333
```
3434

3535
#### Backend
36-
# (expose PRODUCTION=1 in /backend/.env for supabase db, else defaults to local postgres db)
36+
<!-- (expose PRODUCTION=1 in /backend/.env for supabase db, else defaults to local postgres db) -->
3737
```bash
3838
cd backend
3939
python -m venv .venv
@@ -52,19 +52,6 @@ npm install
5252
npm run dev
5353
```
5454

55-
## 🏗️ Build & Test
56-
57-
### Backend
58-
- `python manage.py check` — Django config check
59-
- `python manage.py test` — Run Django tests
60-
- `python manage.py migrate` — Apply migrations
61-
62-
### Frontend
63-
- `npm run build` — Production build
64-
- `npm run lint` — ESLint check
65-
- `npm run dev` — Dev server
66-
- `npm run preview` — Preview production build
67-
6855
## 🌐 API Endpoints
6956

7057
| Description | URL/Command |

backend/apps/events/views.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
from rest_framework.permissions import AllowAny
44
from rest_framework.response import Response
55
from ratelimit.decorators import ratelimit
6-
from django.http import HttpResponse
7-
from django.utils import timezone
8-
from django.utils.html import escape
9-
from django.conf import settings
106

117
from services.openai_service import generate_embedding
128
from utils.embedding_utils import find_similar_events
@@ -317,48 +313,3 @@ def get_google_calendar_urls(request):
317313
{"error": f"Failed to generate Google Calendar URLs: {e!s}"},
318314
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
319315
)
320-
321-
322-
def rss_feed(request):
323-
"""
324-
Simple RSS feed of upcoming events (returns application/rss+xml).
325-
"""
326-
now = timezone.now()
327-
items = Events.objects.filter(dtstart__gte=now).order_by("dtstart")[:50]
328-
329-
site_url = getattr(settings, "SITE_URL", "https://wat2do.ca")
330-
rss_items = []
331-
for ev in items:
332-
title = escape(ev.title or "Untitled event")
333-
link = ev.source_url or f"{site_url}/events/{ev.id}"
334-
description = escape(ev.description or "")
335-
pub_date = ev.dtstamp.astimezone(timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")
336-
guid = f"{ev.id}@wat2do"
337-
enclosure = ""
338-
if ev.source_image_url:
339-
enclosure = f'<media:content url="{escape(ev.source_image_url)}" medium="image" />'
340-
341-
item_xml = f"""
342-
<item>
343-
<title>{title}</title>
344-
<link>{escape(link)}</link>
345-
<description><![CDATA[{description}]]></description>
346-
<guid isPermaLink="false">{guid}</guid>
347-
<pubDate>{pub_date}</pubDate>
348-
{enclosure}
349-
</item>
350-
"""
351-
rss_items.append(item_xml)
352-
353-
rss = f"""<?xml version="1.0" encoding="UTF-8"?>
354-
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
355-
<channel>
356-
<title>Wat2Do — Upcoming events</title>
357-
<link>{site_url}</link>
358-
<atom:link href="{site_url}/rss.xml" rel="self" type="application/rss+xml" />
359-
<description>Upcoming events at the University of Waterloo</description>
360-
<lastBuildDate>{timezone.now().astimezone(timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")}</lastBuildDate>
361-
{''.join(rss_items)}
362-
</channel>
363-
</rss>"""
364-
return HttpResponse(rss, content_type="application/rss+xml")

backend/config/urls.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
from django.urls import include, path
33

44
from apps.core import views
5-
from apps.events import views as events_views
65

76
urlpatterns = [
87
path("admin/", admin.site.urls),
98
path("health/", views.health, name="health"),
109
path("", views.home, name="root"),
11-
path("rss.xml", events_views.rss_feed, name="rss"),
1210
path("api/events/", include("apps.events.urls")),
1311
path("api/clubs/", include("apps.clubs.urls")),
1412
path("api/newsletter/", include("apps.newsletter.urls")),

0 commit comments

Comments
 (0)