sqliteExplorerAppREADME.md1 match
13## Authentication
1415Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
1617## Todos / Plans
sqliteExplorerAppmain.tsx2 matches
27<head>
28<title>SQLite Explorer</title>
29<link rel="preconnect" href="https://fonts.googleapis.com" />
3031<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32<link
33href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34rel="stylesheet"
35/>
3const title = url.split("/wiki/")[1];
45// Construct the API URL
6const apiUrl =
7`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts|pageimages&exintro=1&explaintext=1&titles=${title}&pithumbsize=300`;
89try {
10const response = await fetch(apiUrl);
11const data = await response.json();
12
ownedGamesToSqlitemain.tsx4 matches
3import process from "node:process";
45const STEAM_WEB_API_KEY = process.env.STEAM_WEB_API_KEY;
6const STEAM_ID = process.env.STEAM_ID;
7const DISCORD_WEBSOCKET_URL = process.env.DISCORD_WEBSOCKET_URL;
89export default async function(interval: Interval) {
10if (!STEAM_WEB_API_KEY || !STEAM_ID || !DISCORD_WEBSOCKET_URL) {
11throw new Error("STEAM_WEB_API_KEY, STEAM_ID or DISCORD_WEBSOCKET_URL not set");
12}
1314const url =
15`http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=${STEAM_WEB_API_KEY}&steamid=${STEAM_ID}&format=json&include_played_free_games=true`;
16const options = { method: "GET" };
17
ownedGamesToSqliteREADME.md3 matches
1This val is part of the SteamPlaytimeHistory project which consists of logging your recently played games on steam everyday through valve's API.
23I wanted to log this data so I can analyse which days do I game the most ? which periods do I log the most hours in my confort game (Dead By Daylight) ? And so on. I think the data viz possibilities are super interesting, just like when Valve releases the "Steam in review" at the end of the year
45This val fetches your recent playtime history from valve's API and stores it in a database every day !
67The project uses multiple vals to work:
15To run this project, you'll need:
1617- A steam web api key: https://steamcommunity.com/login/home/?goto=%2Fdev%2Fapikey
18- SteamID of the user (profile needs to be public)
19- Discord websocket url (for error messages)
sqliteExplorerAppREADME.md1 match
13## Authentication
1415Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
1617## Todos / Plans
sqliteExplorerAppmain.tsx2 matches
27<head>
28<title>SQLite Explorer</title>
29<link rel="preconnect" href="https://fonts.googleapis.com" />
3031<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32<link
33href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34rel="stylesheet"
35/>
blob_adminREADME.md1 match
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1011It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1213# TODO
2526export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
27fetchJSON("https://accounts.spotify.com/api/token", {
28method: "POST",
29body: querystring({
3940export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
41fetch("https://accounts.spotify.com/api/token", {
42method: "POST",
43body: new URLSearchParams({
193194try {
195const currentlyPlaying = await fetch("https://api.spotify.com/v1/me/player/currently-playing", {
196method: "GET",
197headers: {
209210if (!mostRecentTrack) {
211const recentTracks = await fetch("https://api.spotify.com/v1/me/player/recently-played", {
212method: "GET",
213headers: {
234235try {
236const playStateResponse = await fetch("https://api.spotify.com/v1/me/player?market=US", {
237method: "GET",
238headers: {
huggingfacePipelinemain.tsx17 matches
1const HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models";
2const HUGGING_FACE_API_KEY = Deno.env.get("HUGGING_FACE_API_KEY");
34const defaultModels = {
6061async featureExtraction(input, options) {
62return this.callHuggingFaceAPI(input, options);
63}
6465async textClassification(input, options) {
66return this.callHuggingFaceAPI(input, options);
67}
6869async tokenClassification(input, options) {
70return this.callHuggingFaceAPI(input, options);
71}
7273async questionAnswering(input, options) {
74return this.callHuggingFaceAPI(input, options);
75}
7677async summarization(input, options) {
78return this.callHuggingFaceAPI(input, options);
79}
8081async translation(input, options) {
82return this.callHuggingFaceAPI(input, options);
83}
8485async textGeneration(input, options) {
86return this.callHuggingFaceAPI(input, options);
87}
8889async sentenceSimilarity(input, options) {
90return this.callHuggingFaceAPI(input, options);
91}
9293async callHuggingFaceAPI(payload, options) {
94try {
95const response = await fetch(`${HUGGING_FACE_API_URL}/${this.model}`, {
96method: "POST",
97headers: {
98"Authorization": `Bearer ${HUGGING_FACE_API_KEY}`,
99"Content-Type": "application/json"
100},
104if (!response.ok) {
105const error = await response.json();
106console.error("Hugging Face API Error:", error);
107return { error: `API request failed: ${error.error}` };
108}
109111return data;
112} catch (error) {
113console.error("Error calling Hugging Face API:", error);
114return { error: "Error calling Hugging Face API" };
115}
116}