From 3387e07ae3900871392424bb82098fa065b97ca9 Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Wed, 1 Apr 2026 20:34:52 -0400 Subject: schema: update YoutubeEntry Add Desc. --- schema/schema.go | 2 + schema/schema_test.go | 48 ++++ schema/testdata/yt-mkbhd.xml | 514 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+) create mode 100644 schema/testdata/yt-mkbhd.xml (limited to 'schema') diff --git a/schema/schema.go b/schema/schema.go index e0712a3..7ef5c99 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -13,6 +13,7 @@ import ( type Entry struct { Id string Title string + Desc string PubTime time.Time Link string } @@ -50,6 +51,7 @@ type YouTubeEntry struct { XMLName xml.Name `xml:"entry"` Id string `xml:"id"` Title string `xml:"group>title"` + Desc string `xml:"group>description"` Pub string `xml:"published"` // RFC3339 PubTime time.Time Link YouTubeLink `xml:"group>content"` diff --git a/schema/schema_test.go b/schema/schema_test.go index b80ad3f..aee2452 100644 --- a/schema/schema_test.go +++ b/schema/schema_test.go @@ -66,3 +66,51 @@ func TestPodcastFeed(t *testing.T) { } } } + +func TestYoutubeFeed(t *testing.T) { + var testFeeds = []string{ + "testdata/yt-mkbhd.xml", + } + for _, feed := range testFeeds { + var bs, err = file.ReadFile(feed) + if err != nil { + t.Errorf("read feed: %v", err) + return + } + var yf = new(YouTubeFeed) + err = xml.Unmarshal(bs, yf) + if err != nil { + t.Errorf("xml unmarshal: %v", err) + return + } + for _, entry := range yf.Entries { + if len(entry.Id) < 1 { + t.Errorf("entry id: %v", entry.Id) + return + } + if len(entry.Title) < 1 { + t.Errorf("entry title: %v", entry.Title) + return + } + if len(entry.Desc) < 1 { + t.Errorf("entry desc: %v", entry.Desc) + return + } + var pt, err = time.Parse(time.RFC3339, entry.Pub) + if err != nil { + t.Errorf("entry pub: %v: '%v'", time.RFC3339, entry.Pub) + return + } + if pt.Unix() < 994702392 { + t.Errorf("entry time: %v", pt) + return + } + _, err = url.Parse(entry.Link.Url) + if err != nil { + t.Errorf("entry link: %v", err) + return + } + } + } +} + diff --git a/schema/testdata/yt-mkbhd.xml b/schema/testdata/yt-mkbhd.xml new file mode 100644 index 0000000..f9e8a43 --- /dev/null +++ b/schema/testdata/yt-mkbhd.xml @@ -0,0 +1,514 @@ + + + + yt:channel:BJycsmduvYEL83R_U4JriQ + BJycsmduvYEL83R_U4JriQ + Marques Brownlee + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2008-03-21T15:25:54+00:00 + + yt:video:Hc0aqOEU2w8 + Hc0aqOEU2w8 + UCBJycsmduvYEL83R_U4JriQ + The Ultimate Minimal Phone + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-04-01T14:10:50+00:00 + 2026-04-01T14:14:41+00:00 + + The Ultimate Minimal Phone + + + It's called the Bluey phone by VTech. It really commits to the idea of a minimal phone. + +MKBHD Merch: http://shop.MKBHD.com + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:eFUB_jL_XcM + eFUB_jL_XcM + UCBJycsmduvYEL83R_U4JriQ + So This is Peak Foldable + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-30T20:56:18+00:00 + 2026-04-01T04:11:43+00:00 + + So This is Peak Foldable + + + Oppo Find N6 has done it. Now what? + +MKBHD Merch: http://shop.MKBHD.com + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Phone provided by Oppo for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:pvjivZ6C6CA + pvjivZ6C6CA + UCBJycsmduvYEL83R_U4JriQ + Every iPhone Camera vs LOW Light + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-30T16:42:18+00:00 + 2026-04-01T01:59:06+00:00 + + Every iPhone Camera vs LOW Light + + + Anything can handle broad daylight + + + + + + + + yt:video:jru9Gsz3kJY + jru9Gsz3kJY + UCBJycsmduvYEL83R_U4JriQ + Every iPhone Ever. SAME photo! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-27T20:07:08+00:00 + 2026-03-30T15:04:14+00:00 + + Every iPhone Ever. SAME photo! + + + iPhone 1 through 17 generation takes the same photo + + + + + + + + yt:video:eXa2ndhmatI + eXa2ndhmatI + UCBJycsmduvYEL83R_U4JriQ + The Windows Laptop Problem + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-25T18:25:28+00:00 + 2026-03-29T21:49:30+00:00 + + The Windows Laptop Problem + + + There are really good Windows laptops - but how can they compete? + +MKBHD Color Picker Sticker Pack: https://geni.us/tAIya9 + +(Affiliate Links) +MacBook Neo: https://geni.us/AATWro +MacBook Pro M5 16”: https://geni.us/6RMSTm +Dell XPS 14: https://howl.link/suo5v5pd7a9ra +Acer Aspire 16: https://geni.us/NSQ3Rg7 + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:D4QyStJWgCc + D4QyStJWgCc + UCBJycsmduvYEL83R_U4JriQ + Nothing Phone 4A/Pro Review: I Have a Theory + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-19T13:01:11+00:00 + 2026-03-22T22:21:19+00:00 + + Nothing Phone 4A/Pro Review: I Have a Theory + + + Nothing isn't making a flagship phone this year. But these phones are their bread and butter. + +MKBHD Merch: http://shop.MKBHD.com + +(Affiliate Link) Nothing 4a Pro: https://geni.us/NKQo + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Phones provided by Nothing for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:j2rszuZ-9PY + j2rszuZ-9PY + UCBJycsmduvYEL83R_U4JriQ + Reviewing Everything on my Desk! (2026) + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-14T20:55:28+00:00 + 2026-03-19T05:53:19+00:00 + + Reviewing Everything on my Desk! (2026) + + + Everything I've had on my desk for years in 1 video. + +Budget version of the same setup: https://youtu.be/fMp3TPlEBQg?si=jF9Nd5sxVvsoEPeI + +MKBHD Merch: http://shop.MKBHD.com + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Links (Affiliate): +XDesk Air Pro: https://www.xdesk.com/air-pro +Herman Miller Embody: https://amzn.to/4dl29m3 +Mac Pro: https://www.apple.com/mac-pro/ +Pro Display XDR: https://www.apple.com/studio-display-xdr/ +Grovemade monitor shelf: https://grovemade.com/product/wood-desk-shelf/?initial=342 +Apollo Twin Gen 2: https://amzn.to/4bFlYmZ +Yamaha HS8: https://amzn.to/4rC9NMD +Sennheiser HD650: https://amzn.to/4rvf2gM +Belkin charging station: https://amzn.to/4luFXbq +Rainy 75 Lite keyboard: https://amzn.to/3N10KGU +MX Master 4: https://amzn.to/46XKYTP +Artisan mousepad: https://amzn.to/414YXUo + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:iGeXGdYE7UE + iGeXGdYE7UE + UCBJycsmduvYEL83R_U4JriQ + Macbook Neo Review: Better than you Think! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-10T23:40:30+00:00 + 2026-03-13T21:49:31+00:00 + + Macbook Neo Review: Better than you Think! + + + Macbook Neo is only $600 bucks, but it's incredibly capable and compelling at this price + +Check out dbrand skins for your MacBook at https://dbrand.com/retro-macbooks + +That shirt! http://shop.MKBHD.com + +(Affiliate Link) MacBook Neo: https://geni.us/JGI8B3f + +Podcast: http://youtube.com/Waveform + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 +MacBook Neo provided by Apple for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:yWI33R4xyIc + yWI33R4xyIc + UCBJycsmduvYEL83R_U4JriQ + Apple Studio Display XDR Review: We're All Pros Now! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-09T20:01:01+00:00 + 2026-03-15T20:45:20+00:00 + + Apple Studio Display XDR Review: We're All Pros Now! + + + The Studio Display XDR is really good. And really expensive. + +MKBHD Merch: http://shop.MKBHD.com + +Apple Studio Display XDR: https://geni.us/eVYQk (Affiliate Link) + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Display provided by Apple for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:nfHRMqqO578 + nfHRMqqO578 + UCBJycsmduvYEL83R_U4JriQ + Samsung Galaxy S26 Ultra Review: There's a Catch + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-06T20:14:58+00:00 + 2026-03-23T00:31:59+00:00 + + Samsung Galaxy S26 Ultra Review: There's a Catch + + + The price is the most "ultra" thing about the S26 Ultra + +MKBHD Merch: http://MKBHD.com + +Samsung Galaxy S26 Ultra: https://geni.us/6Bh61 (Affiliate Link) + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Phone provided by Samsung for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:kBX5WH9b4M4 + kBX5WH9b4M4 + UCBJycsmduvYEL83R_U4JriQ + Macbook Neo Impressions: Reincarnated! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-03-04T22:26:34+00:00 + 2026-03-17T09:41:23+00:00 + + Macbook Neo Impressions: Reincarnated! + + + The new $599 Macbook is a good deal - and it's the computer Apple tried to make 10 years ago. +Save up to 40% off during Ridge’s anniversary sale at https://geni.us/RidgeMKBHD +That shirt: http://shop.MKBHD.com + +Affiliate Links: +MacBook Neo: https://geni.us/JGI8B3f +MacBook Pro M5: https://geni.us/TINvV0 + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:wRaDbRjVrc4 + wRaDbRjVrc4 + UCBJycsmduvYEL83R_U4JriQ + Samsung Galaxy Buds 4 Pro Review: Better than AirPods! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-02-28T22:55:15+00:00 + 2026-03-26T08:02:53+00:00 + + Samsung Galaxy Buds 4 Pro Review: Better than AirPods! + + + Galaxy Buds 4 Pro are sneaky winners! + +MKBHD Merch: http://shop.MKBHD.com + +Affiliate Link: Galaxy Buds 4 Pro - https://geni.us/Ek9oru + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +Earbuds provided by Samsung for review. + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + + yt:video:eGKYiPA1wio + eGKYiPA1wio + UCBJycsmduvYEL83R_U4JriQ + God Tier Stabilization + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-02-26T17:00:39+00:00 + 2026-03-04T17:39:47+00:00 + + God Tier Stabilization + + + S26 Ultra "horizon lock" is impressive + + + + + + + + yt:video:McE6el9mn_I + McE6el9mn_I + UCBJycsmduvYEL83R_U4JriQ + Samsung's Secret Screen Feature + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-02-25T21:38:47+00:00 + 2026-03-30T00:03:14+00:00 + + Samsung's Secret Screen Feature + + + Galaxy S26 Ultra Privacy Display feature is legitimately sweet + + + + + + + + yt:video:FRI78tq9Eik + FRI78tq9Eik + UCBJycsmduvYEL83R_U4JriQ + Samsung Galaxy S26/Ultra Impressions: 1 Crazy Display Feature! + + + Marques Brownlee + https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ + + 2026-02-25T18:00:45+00:00 + 2026-03-17T08:29:13+00:00 + + Samsung Galaxy S26/Ultra Impressions: 1 Crazy Display Feature! + + + Galaxy S26 Ultra has one pretty sick privacy display feature + +Protect your Samsung S26 with dbrand at http://dbrand.com/shop/s26-ultra + +That shirt: http://MKBHD.com + +Affiliate Links: +Samsung Galaxy S26 Ultra: https://geni.us/6Bh61 +Samsung Galaxy S26: https://geni.us/TZA66 + +Playlist of MKBHD Intro music: https://goo.gl/B3AWV5 + +~ +http://twitter.com/MKBHD +http://instagram.com/MKBHD +http://facebook.com/MKBHD + + + + + + + -- cgit v1.2.3