diff --git a/bruno/Invidious/Trending.bru b/bruno/Invidious/Trending.bru new file mode 100644 index 0000000..9e42450 --- /dev/null +++ b/bruno/Invidious/Trending.bru @@ -0,0 +1,11 @@ +meta { + name: Trending + type: http + seq: 1 +} + +get { + url: https://invidious.drgns.space/api/v1/trending + body: none + auth: none +} diff --git a/bruno/Piped/Trending.bru b/bruno/Piped/Trending.bru new file mode 100644 index 0000000..83e7269 --- /dev/null +++ b/bruno/Piped/Trending.bru @@ -0,0 +1,15 @@ +meta { + name: Trending + type: http + seq: 1 +} + +get { + url: https://pipedapi.kavin.rocks/trending?region=NL + body: none + auth: none +} + +query { + region: NL +} diff --git a/bruno/bruno.json b/bruno/bruno.json new file mode 100644 index 0000000..3160fcf --- /dev/null +++ b/bruno/bruno.json @@ -0,0 +1,5 @@ +{ + "version": "1", + "name": "MaterialTube", + "type": "collection" +} \ No newline at end of file diff --git a/package.json b/package.json index 50f633e..3800c69 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,12 @@ "dependencies": { "@nextui-org/react": "^2.2.10", "framer-motion": "^11.0.12", + "ky": "^1.2.2", "next": "14.1.3", "next-pwa": "^5.6.0", "react": "^18", - "react-dom": "^18" + "react-dom": "^18", + "zod": "^3.22.4" }, "devDependencies": { "@types/next-pwa": "^5.6.9", diff --git a/src/app/(trending)/Video.tsx b/src/app/(trending)/Video.tsx new file mode 100644 index 0000000..049892d --- /dev/null +++ b/src/app/(trending)/Video.tsx @@ -0,0 +1,19 @@ +"use client"; + +import Client from "@/client"; +import { ApiType } from "@/client/adapters"; +import { Component } from "@/typings/component"; +import { useEffect } from "react"; + +export const Video: Component = ({}) => { + useEffect(() => { + const client = new Client([ + { baseUrl: "https://invidious.drgns.space", type: ApiType.Invidious }, + { baseUrl: "https://pipedapi.kavin.rocks", type: ApiType.Piped } + ]); + + client.getTrending("US").then(console.log); + }, []); + + return <>; +}; diff --git a/src/app/page.tsx b/src/app/(trending)/page.tsx similarity index 69% rename from src/app/page.tsx rename to src/app/(trending)/page.tsx index e7d4c01..4068cd6 100644 --- a/src/app/page.tsx +++ b/src/app/(trending)/page.tsx @@ -1,9 +1,10 @@ import { Button } from "@nextui-org/button"; +import { Video } from "./Video"; export default function Home() { return ( <> - +