ok.... wip
This commit is contained in:
Binary file not shown.
@@ -1,7 +1,43 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/joho/godotenv"
|
||||||
|
)
|
||||||
|
|
||||||
|
type channel struct {
|
||||||
|
Id string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Kind string `json:"kind"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type videos struct {
|
||||||
|
Id string
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println("Hello, World!")
|
channellist := "https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json"
|
||||||
|
err := godotenv.Load()
|
||||||
|
if err != nil {
|
||||||
|
}
|
||||||
|
apikey := os.Getenv("APIKEY")
|
||||||
|
resp, err := http.Get(channellist)
|
||||||
|
defer resp.Body.Close()
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
output := []channel{}
|
||||||
|
json.Unmarshal(body, &output)
|
||||||
|
week, _ := time.ParseDuration("168h")
|
||||||
|
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}"
|
||||||
|
fmt.Println(output)
|
||||||
|
fmt.Println(apikey)
|
||||||
}
|
}
|
||||||
|
1
homegrown/yt-email/test.txt
Normal file
1
homegrown/yt-email/test.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"ljdslkajfds"
|
Reference in New Issue
Block a user