From 7bff9a93428b4ab3631a67fa7ced180d5d875d7f Mon Sep 17 00:00:00 2001 From: bvanroll Date: Sun, 3 Aug 2025 19:42:53 +0200 Subject: [PATCH] YESSSSSSSS --- homegrown/email-rust/src/.main.rs.swp | Bin 0 -> 12288 bytes homegrown/yt-email/main.go | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 homegrown/email-rust/src/.main.rs.swp diff --git a/homegrown/email-rust/src/.main.rs.swp b/homegrown/email-rust/src/.main.rs.swp new file mode 100644 index 0000000000000000000000000000000000000000..266d3785ec6e8cfc248264671fbd2fd06a06b0ee GIT binary patch literal 12288 zcmeI2&u<$=6vwAX97-u5xbWjLb>(P{;vJhFs!rlmRf8ZxsUkIv)FPCQcgOLN_3Sb; zwlS9B!krUb_!mH2xpL!Q;KT*NnG+`@zO%b=;`9(IE>xP4zdPQyvv1z}%)FH>Z@+V} zvrBKqU4r%sA%9Q48b1D^`~1DTg!E-mNN>NOjrv8L<%!5H825SUkiDlI8|EWf9*#^t z)l80r%GzdZ9kV83IMcDQ7q|F(63hs`34$7d(iJM67n-Ng9Nk#b)h#QcZHBY5!<)W0-8b- z$j57;&;o%#AP@)y0)apv5C{bR{{$90<3z&U$lnv_&8cv5HS+UOsuXBctkQ}fAW=n?rYGssdAVAiXgLQ)H@w$IHQw9Hh#FQayi@GX z*!{2`^+%^hGOqYXjpoC4bJT98`_1=xbC);oKSE5Dv8a3NW~bfh;9^}UnN>JFDPUt{W|Ef8bcuuZ==<;KQ z9pEh=;m2l~s}>{4>3xR>)X{orQR(S9mSCJXdQd)y;G@3jSm`r^JhFe~re4M}7L==+ u$Y@(4eI+vWnQS2@z@SwkoLBuuX?tSxzFpa^OF2i{^_ky6oS*TzLCHU>B>r3g literal 0 HcmV?d00001 diff --git a/homegrown/yt-email/main.go b/homegrown/yt-email/main.go index 9affaf8..802098e 100644 --- a/homegrown/yt-email/main.go +++ b/homegrown/yt-email/main.go @@ -1,11 +1,13 @@ package main import ( + "bytes" "encoding/json" "fmt" "io" "net/http" "os" + "text/template" "time" "github.com/joho/godotenv" @@ -22,6 +24,14 @@ type videos struct { Name string } +type videourl struct { + Id string + Part string + Order string + Date string + Key string +} + func main() { channellist := "https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json" err := godotenv.Load() @@ -37,7 +47,19 @@ func main() { date := time.Now().Add(-week) //bro wtf is up with go here man this is ass :D datestr := date.Format("2006-01-02T15:04:05Z") - videosstr := "https://www.googleapis.com/youtube/v3/search/?channelId={id}&part={part},id&order={order}&publishedAfter={date}&key={apikey}" + videosstr := "https://www.googleapis.com/youtube/v3/search/?channelId={{.Id}}&part={{.Part}},id&order={{.Order}}&publishedAfter={{.Date}}&key={{.Key}}" + templ, err := template.New("test").Parse(videosstr) + for i, val := range output { + temp := videourl{val.Id, "snippet", "date", datestr, apikey} + var output bytes.Buffer + templ.Execute(&output, temp) + resp, err := http.Get(output.String()) + body, err := io.ReadAll(resp.Body) + fmt.Println(string(body)) + fmt.Println(i) + fmt.Println(err) + + } fmt.Println(output) fmt.Println(apikey) }