Skip to content

Commit b258675

Browse files
committed
Add social media cards, robots.txt, and other SEO BS
1 parent 02f849c commit b258675

File tree

9 files changed

+254
-23
lines changed

9 files changed

+254
-23
lines changed

api/api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,16 @@ def __init__(self, filename):
443443
super().__init__(filename, 'image/x-icon')
444444

445445

446+
class XMLResource(StaticResource):
447+
def __init__(self, filename):
448+
super().__init__(filename, 'application/xml; charset=utf-8')
449+
450+
451+
class TextPlainResource(StaticResource):
452+
def __init__(self, filename):
453+
super().__init__(filename, 'text/plain; charset=utf-8')
454+
455+
446456
# Create Falcon app
447457
falcon_app = falcon.App()
448458

@@ -451,6 +461,8 @@ def __init__(self, filename):
451461
falcon_app.add_route('/dashboard', TextResource('dashboard.html'))
452462
falcon_app.add_route('/about', TextResource('about.html'))
453463
falcon_app.add_route('/favicon.ico', IconResource('static/favicon.ico'))
464+
falcon_app.add_route('/sitemap.xml', XMLResource('sitemap.xml'))
465+
falcon_app.add_route('/robots.txt', TextPlainResource('robots.txt'))
454466
falcon_app.add_route('/status', StatusResource())
455467
falcon_app.add_route('/health', HealthResource())
456468
falcon_app.add_route('/latest-image', LatestImageResource())

api/html/about.html

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,35 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
7+
<!-- SEO Meta Tags -->
8+
<meta name="description" content="Learn how MuniMet.ro uses computer vision to track SF Muni Metro subway status in real-time.">
9+
<link rel="canonical" href="https://munimet.ro/about">
10+
11+
<!-- Open Graph / Facebook -->
12+
<meta property="og:type" content="website">
13+
<meta property="og:url" content="https://munimet.ro/about">
14+
<meta property="og:title" content="About MuniMet.ro - SF Muni Metro Status">
15+
<meta property="og:description" content="Learn how MuniMet.ro uses computer vision to track SF Muni Metro subway status in real-time.">
16+
<meta property="og:image" content="https://munimet.ro/static/og-image.png">
17+
<meta property="og:site_name" content="MuniMet.ro">
18+
19+
<!-- Twitter Card -->
20+
<meta name="twitter:card" content="summary_large_image">
21+
<meta name="twitter:title" content="About MuniMet.ro - SF Muni Metro Status">
22+
<meta name="twitter:description" content="Learn how MuniMet.ro uses computer vision to track SF Muni Metro subway status in real-time.">
23+
<meta name="twitter:image" content="https://munimet.ro/static/og-image.png">
24+
25+
<!-- Favicons -->
626
<link rel="icon" href="/static/favicon.png">
727
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
828
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
929
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
1030
<link rel="manifest" href="/static/site.webmanifest">
11-
<title>MuniMet.ro</title>
12-
<link rel="stylesheet" href="/static/style.css">
13-
<style>
14-
.pi-easter-egg {
15-
position: fixed;
16-
bottom: 8px;
17-
right: 20px;
18-
font-size: 14px;
19-
color: rgb(221, 216, 216);
20-
text-decoration: none;
21-
font-family: serif;
22-
transition: color 0.3s ease;
23-
z-index: 1000;
24-
}
25-
.pi-easter-egg:hover {
26-
color: rgba(128, 128, 128, 0.6);
27-
}
28-
</style>
31+
<meta name="theme-color" content="#9f9">
32+
33+
<title>About MuniMet.ro</title>
34+
<link rel="stylesheet" href="/static/style.css">
2935
</head>
3036
<body>
3137
<div class="container">
@@ -58,8 +64,8 @@ <h2>What's going on</h2>
5864
<b>🕶️ 1. Computer Vision</b>
5965
</p>
6066
<p>
61-
A program automatically downloads images from Muni's subway screen
62-
every few minutes and scans them for data including tracks,
67+
A program automatically downloads an image from Muni's subway
68+
screen every few minutes and scans it for data including tracks,
6369
stations, and trains.
6470
</p>
6571
<p>
@@ -113,6 +119,6 @@ <h2>Credits</h2>
113119
</div>
114120

115121
<!-- This link is for Sandra Bullock only. -->
116-
<a href="/dashboard" class="pi-easter-egg" title="π">π</a>
122+
<a href="/dashboard" class="easter-egg" title="π">π</a>
117123
</body>
118124
</html>

api/html/analytics.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,31 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
7+
<!-- SEO Meta Tags -->
8+
<meta name="description" content="SF Muni Metro delay analytics - see delay patterns by station, time of day, and day of week.">
9+
<link rel="canonical" href="https://munimet.ro/analytics">
10+
11+
<!-- Open Graph / Facebook -->
12+
<meta property="og:type" content="website">
13+
<meta property="og:url" content="https://munimet.ro/analytics">
14+
<meta property="og:title" content="Delay Analytics - MuniMet.ro">
15+
<meta property="og:description" content="SF Muni Metro delay analytics - see delay patterns by station, time of day, and day of week.">
16+
<meta property="og:image" content="https://munimet.ro/static/og-image.png">
17+
<meta property="og:site_name" content="MuniMet.ro">
18+
19+
<!-- Twitter Card -->
20+
<meta name="twitter:card" content="summary_large_image">
21+
<meta name="twitter:title" content="Delay Analytics - MuniMet.ro">
22+
<meta name="twitter:description" content="SF Muni Metro delay analytics - see delay patterns by station, time of day, and day of week.">
23+
<meta name="twitter:image" content="https://munimet.ro/static/og-image.png">
24+
25+
<!-- Favicons -->
626
<link rel="icon" href="/static/favicon.png">
727
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
28+
<link rel="manifest" href="/static/site.webmanifest">
29+
<meta name="theme-color" content="#9f9">
30+
831
<title>Delay Analytics - MuniMet.ro</title>
932
<link rel="stylesheet" href="/static/style.css">
1033
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>

api/html/index.html

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,77 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
66
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
7+
8+
<!-- SEO Meta Tags -->
9+
<meta name="description" content="Real-time SF Muni Metro subway status. Check if the San Francisco subway is running on time, experiencing delays, or not operating.">
10+
<meta name="keywords" content="Muni, Metro, SF, San Francisco, subway, transit, status, delays, SFMTA">
11+
<meta name="author" content="Eric Gregory">
12+
<link rel="canonical" href="https://munimet.ro/">
13+
14+
<!-- Open Graph / Facebook -->
15+
<meta property="og:type" content="website">
16+
<meta property="og:url" content="https://munimet.ro/">
17+
<meta property="og:title" content="MuniMet.ro - SF Muni Metro Status">
18+
<meta property="og:description" content="Real-time SF Muni Metro subway status. Check if the San Francisco subway is running on time, experiencing delays, or not operating.">
19+
<meta property="og:image" content="https://munimet.ro/static/og-image.png">
20+
<meta property="og:image:width" content="1200">
21+
<meta property="og:image:height" content="630">
22+
<meta property="og:site_name" content="MuniMet.ro">
23+
<meta property="og:locale" content="en_US">
24+
25+
<!-- Twitter Card -->
26+
<meta name="twitter:card" content="summary_large_image">
27+
<meta name="twitter:url" content="https://munimet.ro/">
28+
<meta name="twitter:title" content="MuniMet.ro - SF Muni Metro Status">
29+
<meta name="twitter:description" content="Real-time SF Muni Metro subway status. Check if the San Francisco subway is running on time, experiencing delays, or not operating.">
30+
<meta name="twitter:image" content="https://munimet.ro/static/og-image.png">
31+
32+
<!-- Favicons -->
733
<link rel="icon" href="/static/favicon.png">
834
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
935
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
1036
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
1137
<link rel="manifest" href="/static/site.webmanifest">
38+
<meta name="theme-color" content="#9f9">
39+
40+
<!-- RSS Feed -->
1241
<link rel="alternate" type="application/rss+xml" title="SF Muni Metro Status" href="https://munimet.ro/feed.xml">
42+
1343
<title>MuniMet.ro</title>
14-
<link rel="stylesheet" href="/static/style.css">
44+
<link rel="stylesheet" href="/static/style.css">
45+
46+
<!-- JSON-LD Structured Data -->
47+
<script type="application/ld+json">
48+
{
49+
"@context": "https://schema.org",
50+
"@type": "WebApplication",
51+
"name": "MuniMet.ro",
52+
"description": "Real-time SF Muni Metro subway status tracker",
53+
"url": "https://munimet.ro",
54+
"applicationCategory": "Transportation",
55+
"operatingSystem": "Any",
56+
"offers": {
57+
"@type": "Offer",
58+
"price": "0",
59+
"priceCurrency": "USD"
60+
},
61+
"author": {
62+
"@type": "Person",
63+
"name": "Eric Gregory",
64+
"url": "https://mrericsir.github.io/"
65+
},
66+
"sourceOrganization": {
67+
"@type": "Organization",
68+
"name": "MuniMet.ro",
69+
"url": "https://munimet.ro"
70+
},
71+
"about": {
72+
"@type": "Thing",
73+
"name": "San Francisco Muni Metro",
74+
"description": "San Francisco's light rail and subway system"
75+
}
76+
}
77+
</script>
1578
</head>
1679
<body>
1780
<div class="container">

api/html/robots.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# robots.txt for munimet.ro
2+
3+
# Allow regular search engines
4+
User-agent: Googlebot
5+
Allow: /
6+
7+
User-agent: Bingbot
8+
Allow: /
9+
10+
User-agent: *
11+
Allow: /
12+
13+
# Sitemap location
14+
Sitemap: https://munimet.ro/sitemap.xml
15+
16+
# Disallow internal/debug endpoints
17+
Disallow: /status
18+
Disallow: /health
19+
Disallow: /latest-image
20+
Disallow: /analytics-data
21+
Disallow: /dashboard
22+
23+
# Block AI training crawlers
24+
User-agent: GPTBot
25+
Disallow: /
26+
27+
User-agent: ChatGPT-User
28+
Disallow: /
29+
30+
User-agent: Google-Extended
31+
Disallow: /
32+
33+
User-agent: CCBot
34+
Disallow: /
35+
36+
User-agent: anthropic-ai
37+
Disallow: /
38+
39+
User-agent: ClaudeBot
40+
Disallow: /
41+
42+
User-agent: Claude-Web
43+
Disallow: /
44+
45+
User-agent: cohere-ai
46+
Disallow: /
47+
48+
User-agent: FacebookBot
49+
Disallow: /
50+
51+
User-agent: Bytespider
52+
Disallow: /
53+
54+
User-agent: Omgilibot
55+
Disallow: /
56+
57+
User-agent: PerplexityBot
58+
Disallow: /
59+
60+
User-agent: Diffbot
61+
Disallow: /
62+
63+
User-agent: ImagesiftBot
64+
Disallow: /
65+
66+
User-agent: Applebot-Extended
67+
Disallow: /

api/html/sitemap.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://munimet.ro/</loc>
5+
<changefreq>always</changefreq>
6+
<priority>1.0</priority>
7+
</url>
8+
<url>
9+
<loc>https://munimet.ro/about</loc>
10+
<changefreq>monthly</changefreq>
11+
<priority>0.8</priority>
12+
</url>
13+
<url>
14+
<loc>https://munimet.ro/analytics</loc>
15+
<changefreq>daily</changefreq>
16+
<priority>0.7</priority>
17+
</url>
18+
<url>
19+
<loc>https://munimet.ro/feed.xml</loc>
20+
<changefreq>always</changefreq>
21+
<priority>0.6</priority>
22+
</url>
23+
</urlset>

api/html/static/og-image.png

160 KB
Loading

api/html/static/site.webmanifest

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
{"name":"","short_name":"","icons":[{"src":"/static/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/static/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
1+
{
2+
"name": "MuniMet.ro - SF Muni Metro Status",
3+
"short_name": "MuniMet.ro",
4+
"description": "Real-time SF Muni Metro subway status",
5+
"start_url": "/",
6+
"display": "standalone",
7+
"background_color": "#f7fafc",
8+
"theme_color": "#9f9",
9+
"icons": [
10+
{
11+
"src": "/static/android-chrome-192x192.png",
12+
"sizes": "192x192",
13+
"type": "image/png"
14+
},
15+
{
16+
"src": "/static/android-chrome-512x512.png",
17+
"sizes": "512x512",
18+
"type": "image/png"
19+
}
20+
]
21+
}

api/html/static/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ p.sub-credits {
193193
text-decoration: underline;
194194
}
195195

196+
/* Easter egg link */
197+
.easter-egg {
198+
position: fixed;
199+
bottom: 8px;
200+
right: 20px;
201+
font-size: 14px;
202+
color: rgb(221, 216, 216);
203+
text-decoration: none;
204+
font-family: serif;
205+
transition: color 0.3s ease;
206+
z-index: 1000;
207+
}
208+
209+
.easter-egg:hover {
210+
color: rgba(128, 128, 128, 0.6);
211+
}
212+
196213
.details {
197214
flex-shrink: 0;
198215
margin-bottom: 15px;

0 commit comments

Comments
 (0)