···33 --bg-body: white;
44 --text-main: #222; /* Default text color */
55 --text-muted: #aaa;
66-66+77 /* Masthead */
88 --masthead-text: #000;
99 --masthead-border: #000;
···2020 --link-color: #2c6e2f;
2121 --quote-color: #d65a00;
2222 --header-color: #aaa;
2323-2323+2424 /* OG Preview (Cards) */
2525 --og-border: #e1e8ed;
2626 --og-bg: #fff;
2727 --og-title: #14171a;
2828 --og-desc: #657786;
2929-2929+3030 /* Slack-like OG */
3131 --slack-border: #e0e0e0;
3232 --slack-site-info: #696969;
···3939 --footer-border: #eee;
4040 --footer-text: #666;
4141 --footer-link: #444;
4242-4242+4343 /* Icon Fill */
4444 --icon-fill: #000000;
4545}
···4949 --bg-body: #121212;
5050 --text-main: #e0e0e0;
5151 --text-muted: #888;
5252-5252+5353 /* Masthead */
5454 --masthead-text: #fff;
5555 --masthead-border: #fff;
···6666 --link-color: #66bb6a;
6767 --quote-color: #ffb74d;
6868 --header-color: #888;
6969-6969+7070 /* OG Preview (Cards) */
7171 --og-border: #333;
7272 --og-bg: #1e1e1e;
7373 --og-title: #e0e0e0;
7474 --og-desc: #aaa;
7575-7575+7676 /* Slack-like OG */
7777 --slack-border: #444;
7878 --slack-site-info: #888;
···112112 margin: 0 auto;
113113 flex: 1;
114114 box-sizing: border-box; /* Include padding in width calculation */
115115-115115+116116 /* CSS Grid Layout */
117117 display: grid;
118118 grid-template-columns: 1fr 250px;
···128128#masthead {
129129 /* Span full width of the grid */
130130 grid-column: 1 / -1;
131131-131131+132132 font-size: 72px;
133133 font-weight: bold;
134134 line-height: 68px;
···139139 display: flex;
140140 justify-content: space-between;
141141 align-items: center;
142142-143143- /* Reset previous negative margins/padding if they interfere,
144144- but keeping some padding might be desired for the text look.
142142+143143+ /* Reset previous negative margins/padding if they interfere,
144144+ but keeping some padding might be desired for the text look.
145145 Let's simplify for the grid context. */
146146 margin: 0 0 20px 0;
147147 padding: 0;
···158158 /* Grid placement */
159159 grid-column: 2;
160160 grid-row: 2; /* Starts after masthead */
161161-161161+162162 width: 100%; /* Take full width of the column */
163163}
164164165165#content {
166166 /* Grid placement */
167167 grid-column: 1;
168168-168168+169169 width: 100%; /* Take full width of the column */
170170}
171171···412412#navigation {
413413 /* Grid placement */
414414 grid-column: 1;
415415-415415+416416 width: 100%;
417417 text-align: left;
418418 padding-bottom: 20px;
···496496.og-image img {
497497 max-width: 100%;
498498 border-radius: 8px; /* Slack likes rounder corners on media */
499499- border: 1px solid var(--slack-img-border);
499499+ border: 1px solid var(--slack-img-border);
500500 display: block;
501501 /* Reset styles from .item img */
502502 padding: 0 !important;
+1-1
internal/assets/roast/database_setup.md
···3636 ```bash
3737 mysql -u root -p < sql/sql_setup
3838 ```
3939-3939+4040 Or let the setup script create the database automatically.
414142423. Run the setup script:
+3-3
internal/data/gorm_store.go
···264264 var results []TimelineItem
265265266266 query := `
267267- SELECT
267267+ SELECT
268268 'link' as type, ircLinkID as id, timestamp, title, url, '' as content, user as author, '' as md5sum
269269 FROM ircLink
270270 UNION ALL
271271- SELECT
271271+ SELECT
272272 'quote' as type, quoteID as id, timestamp, '' as title, '' as url, quote as content, author as author, '' as md5sum
273273 FROM quote
274274 UNION ALL
275275- SELECT
275275+ SELECT
276276 'image' as type, imageID as id, timestamp, title, url, '' as content, '' as author, md5sum
277277 FROM image
278278 ORDER BY timestamp DESC
+1-1
tests/fixtures_hot.sql
···11-- Insert items from 8 days ago (Hot Links window is 6-12 days)
22-INSERT INTO ircLink (user, title, url, clicks, content_type, timestamp) VALUES
22+INSERT INTO ircLink (user, title, url, clicks, content_type, timestamp) VALUES
33('history_buff', 'Ancient Link 1', 'http://old.example.com/1', 10, 'text', datetime('now', '-8 days')),
44('history_buff', 'Ancient Link 2', 'http://old.example.com/2', 5, 'text', datetime('now', '-8 days')),
55('history_buff', 'Ancient Link 3', 'http://old.example.com/3', 20, 'text', datetime('now', '-9 days'));
+1-1
tests/fixtures_hot_mysql.sql
···11-- Insert items from 8 days ago (Hot Links window is 6-12 days)
22-INSERT INTO ircLink (user, title, url, clicks, content_type, timestamp) VALUES
22+INSERT INTO ircLink (user, title, url, clicks, content_type, timestamp) VALUES
33('history_buff', 'Ancient Link 1', 'http://old.example.com/1', 10, 'text', DATE_SUB(NOW(), INTERVAL 8 DAY)),
44('history_buff', 'Ancient Link 2', 'http://old.example.com/2', 5, 'text', DATE_SUB(NOW(), INTERVAL 8 DAY)),
55('history_buff', 'Ancient Link 3', 'http://old.example.com/3', 20, 'text', DATE_SUB(NOW(), INTERVAL 9 DAY));
+9-9
tests/preview_test.sh
···16161717 # URL Encode
1818 ENCODED_URL=$(jq -nr --arg v "$URL" '$v|@uri')
1919-1919+2020 echo -n " Test: $NAME... "
2121-2121+2222 RESPONSE=$(curl -s "$ENDPOINT?url=$ENCODED_URL")
2323-2323+2424 # Check if curl failed
2525 if [ $? -ne 0 ]; then
2626 echo "FAIL (curl error)"
2727 FAILURES=$((FAILURES + 1))
2828 return
2929 fi
3030-3030+3131 # Check assertion
3232 MATCH=$(echo "$RESPONSE" | jq -e "$JQ_FILTER" 2>/dev/null)
3333-3333+3434 if [ "$MATCH" = "true" ]; then
3535 echo "PASS"
3636 else
···4848 "https://www.reddit.com/r/valheim/comments/leqdj6/our_first_encounter_with_the_troll/" \
4949 '.provider_name == "Reddit" or .title != null'
50505151-# Invalid: specific non-existent post.
5252-# Note: Reddit might redirect 404s to search pages or return 200 with "Not Found" content,
5151+# Invalid: specific non-existent post.
5252+# Note: Reddit might redirect 404s to search pages or return 200 with "Not Found" content,
5353# so exact behavior is tricky. But tryOEmbed likely fails 404, scraper might find garbage or nothing.
5454# We expect "error" or empty-ish response if strictly handled, but scraper might find "Reddit - Dive into..." title.
5555# Let's rely on "custom" logic failing or returning generic "Reddit" title which might pass 'Valid' check?
5656-# For now, let's assume 'Invalid' means we check for absence of specific post content if possible,
5656+# For now, let's assume 'Invalid' means we check for absence of specific post content if possible,
5757# OR just that it doesn't crash. But user requested testing 404 logic.
5858# If preview_reddit.go fails, it falls back.
5959test_preview "Reddit Invalid" \
···686869697070# Invalid
7171-# Spotify returns a 200 OK on invalid tracks with a "Spotify - Web Player" title,
7171+# Spotify returns a 200 OK on invalid tracks with a "Spotify - Web Player" title,
7272# so we expect a valid scrape fallback, not an error.
7373test_preview "Spotify Invalid" \
7474 "https://open.spotify.com/track/INVALID_TRACK_ID" \