YESSSSSSSS

This commit is contained in:
2025-08-03 19:42:53 +02:00
parent e027dc6054
commit 7bff9a9342
2 changed files with 23 additions and 1 deletions

Binary file not shown.

View File

@@ -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)
}