Search

Results include substring matches and semantically similar vals. Learn more
eyeseethru avatar
add_to_notion_w_ai
@eyeseethru
Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry. Use addToNotion with any database id and content. await addToNotion( "DB_ID_GOES_HERE", "CONTENT_GOES HERE"//"for example: $43.28 ordered malai kofta and kadhi (doordash) [me and mom] jan 3 2024" ); Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions). Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email Uses NOTION_API_KEY , OPENAI_API_KEY stored in env variables and uses Valtown blob storage to store information about the database. Use get_notion_db_info to use the stored blob if exists or create one, use get_and_save_notion_db_info to create a new blob (and replace an existing one if exists).
Script
import Instructor from "npm:@instructor-ai/instructor";
import { Client } from "npm:@notionhq/client";
import OpenAI from "npm:openai";
const NOTION_API_KEY = process.env.NOTION_API_KEY;
const notion = new Client({
auth: NOTION_API_KEY,
apiKey: process.env.OPENAI_API_KEY ?? undefined,
const client = Instructor({
client: oai,
mode: "TOOLS",
const db_info = await get_notion_db_info(dbid);
const processed_message = await client.chat.completions.create({
messages: [{ role: "system", content: db_info["system_message"] }, { role: "user", content: text }],
raymondcamden avatar
getAccessToken
@raymondcamden
An interactive, runnable TypeScript val by raymondcamden
Script
const params = new URLSearchParams();
params.append("client_secret", secret);
params.append("grant_type", "client_credentials");
params.append("scope", "openid,AdobeID,read_organizations");
let resp = await fetch(`https://ims-na1.adobelogin.com/ims/token/v2?client_id=${id}`, {
method: "POST",
pomdtr avatar
excalidraw
@pomdtr
Excalidraw, embedded inside Val Town ! The drawing will be persisted in your blobs as json / png / svg. You can access the drawing source directly using the /json , /png and /svg subpaths. For example, to embed the image in a markdown document, you can use: ![pomdtr-excalidraw.web.val.run](https://pomdtr-excalidraw.web.val.run/png)
HTTP (deprecated)
# Excalidraw, embedded inside Val Town !
The drawing will be persisted in your blobs as json / png / svg.
cingozilyas avatar
sweetAzureFinch
@cingozilyas
An interactive, runnable TypeScript val by cingozilyas
Script
const Airtable = require("airtable");
export default async function saveToAirtable(videoName, videoDescription, videoCover, videoFile, clientLogo) {
// Set up your Airtable API key and base ID
{ url: videoCover }, // assuming videoCover is a URL to the uploaded file
"ssa-video-clientLogo": [
{ url: clientLogo }, // assuming clientLogo is a URL to the uploaded file
"ssa-video-videoFile": [
pdebie avatar
syncCommentToLemmy
@pdebie
This allows copying specific comments from Reddit to a Lemmy thread. Might be super specific to my use case, but we use this for example to copy over some content from the r/SpaceX Starship thread to the one on the Lemmy community (with their blessing).
Script
return hash;
const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
let client = new LemmyHttp(`https://${instance}`, {
fetchFunction: fetch,
// (client as any)["#fetchFunction"] = fetch;
let comments = (await fetchRss(redditUrl)).filter((i) =>
lemmyId: undefined,
const ret = await client.createComment({
post_id: postId,
if (existingStatus.contentHash !== contentHash) {
await client.editComment({
comment_id: existingStatus.lemmyId,
ajax avatar
resume
@ajax
// set by ajax.resumeHtml at 2023-06-07T20:30:59.005Z
Script
"name": "Joey Flores, Co-founder and CEO of Earbits, Inc."
sure of working with Thomas for the past three years at Earbits, and on a few side projects. Two years ago our CTO left on a
"name": "Yotam Rosenbaum, SVP of Operations, Earbits, Inc."
"skills": [{
L / JSX", "SCSS / CSS / BEM / Styled Components", "Javascript / Typescript", "React / Next", "Redux / Apollo"],
"level": "Senior",
"startDate": "2020-05-05",
e the users keys locally and used them to sign transactions and contracts.", "React", "Redux", "SCSS", "Product"],
"startDateYear": "2020",
"endDate": "2020-01-01",
roviders and connecting their platforms to help us achieve liquid markets.", "React, Apollo, Styled Components", "Node.js / R
"startDateYear": "2018",
"boolHighlights": true
"highlights": ["Built a very large and complex React / Redux application. It works on all platforms and has IOS/Android b
"website": "https://listium.com",
iamseeley avatar
hfApiGateway
@iamseeley
🤖 A gateway to Hugging Face's Inference API You can perform various NLP tasks using different models . The gateway supports multiple tasks, including feature extraction, text classification, token classification, question answering, summarization, translation, text generation, and sentence similarity. Features Feature Extraction : Extract features from text using models like BAAI/bge-base-en-v1.5 . Text Classification : Classify text sentiment, emotions, etc., using models like j-hartmann/emotion-english-distilroberta-base . Token Classification : Perform named entity recognition (NER) and other token-level classifications. Question Answering : Answer questions based on a given context. Summarization : Generate summaries of longer texts. Translation : Translate text from one language to another. Text Generation : Generate text based on a given prompt. Sentence Similarity : Calculate semantic similarity between sentences. Usage Send a POST request with the required inputs to the endpoint with the appropriate task and model parameters. Or use the default models. # Example Default Model Request curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction" Example Requests Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": ["Hello World", "Goodbye World"]}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=BAAI/bge-base-en-v1.5" Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=sentence-transformers/all-MiniLM-L6-v2" Text Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "I love programming!"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-classification&model=j-hartmann/emotion-english-distilroberta-base" Token Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "My name is John and I live in New York."}' "https://iamseeley-hfApiGateway.web.val.run/?task=token-classification&model=dbmdz/bert-large-cased-finetuned-conll03-english" Question Answering curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"question": "What is the capital of France?", "context": "The capital of France is Paris, a major European city and a global center for art, fashion, gastronomy, and culture."}}' "https://iamseeley-hfapigateway.web.val.run/?task=question-answering&model=deepset/roberta-base-squad2" Summarization curl -X POST -H "Content-Type: application/json" -d '{"inputs": "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."}' "https://iamseeley-hfapigateway.web.val.run/?task=summarization&model=sshleifer/distilbart-cnn-12-6" Translation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Hello, how are you?"}' "https://iamseeley-hfapigateway.web.val.run/?task=translation&model=google-t5/t5-small" Text Generation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Once upon a time"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-generation&model=gpt2" Sentence Similarity curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World"]}}' "https://iamseeley-hfapigateway.web.val.run/?task=sentence-similarity&model=sentence-transformers/all-MiniLM-L6-v2" Val Examples Using Pipeline import Pipeline from "https://esm.town/v/iamseeley/pipeline"; // ... } else if (req.method === "POST") { const { inputs } = await req.json(); const pipeline = new Pipeline("task", "model"); const result = await pipeline.run(inputs); return new Response(JSON.stringify(result), { headers: { "Content-Type": "application/json" } }); } } exampleTranslation exampleTextClassification exampleFeatureExtraction exampleTextGeneration exampleSummarization exampleQuestionAnswering
HTTP (deprecated)
```bash
structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower
**Translation**
petermillspaugh avatar
sendEmailNewsletter
@petermillspaugh
Val Town email subscriptions: send email newsletter Cousin Val to @petermillspaugh/emailSubscription — see docs there. This Val has a few layers of protection to avoid double sending. Those mechanisms feel pretty hacky, so any suggestions are welcome! Feel free to comment on the Val or submit a PR.
Cron
/** @jsxImportSource https://esm.sh/preact */
import { generateNewsletterJsx } from "https://esm.town/v/petermillspaugh/generateNewsletterJsx";
import { newsletters } from "https://esm.town/v/petermillspaugh/newsletters";
import { email as sendEmail } from "https://esm.town/v/std/email?v=11";
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
import { render } from "npm:preact-render-to-string";
type SubscriberRow = [
subscriberId: number,
fossforlife avatar
lastFmNowPlaying
@fossforlife
An interactive, runnable TypeScript val by fossforlife
Script
import LastFm from "npm:lastfm-node-client";
const lastFm = new LastFm(Deno.env.get("LASTFM_API_KEY"));
const data = await lastFm.userGetRecentTracks({
augustohp avatar
BalanceAntiCaptcha
@augustohp
An interactive, runnable TypeScript val by augustohp
Script
method: "POST",
body: JSON.stringify({
clientKey: token,
if (result.errorId != 0) {
throw new Error("Could not fetch balance.");
saolsen avatar
plausible
@saolsen
Plausible analytics Call track with the domain you set up in plausible and the request. I've been using saolsen.val-name . Note that there is no auth for the plausible events API, so if somebody forks the val it'll still work but track all their val page loads in your dashboard which is kinda weird but also kinda cool, idk. See https://www.val.town/v/saolsen/plausible_example for how to use.
Script
headers: {
"User-Agent": req.headers.get("user-agent")!,
"X-Forwarded-For": req.headers.get("true-client-ip")!,
"Content-Type": "application/json",
body: JSON.stringify({
karfau avatar
githubWebhookApproveDependencyPRs
@karfau
A webhook to approve dependency PRs created by bots The webhook can be configured on the repo or on the org level it needs to have the Payload URL set to the "web endpoint" of the val ( ... -> Endpoints -> Copy web endpoint) it needs to POST a json payload it needs to receive the workflow_runs events it needs to have the webhookSecret configured to the same value as in val town secrets (line 7) (else response is 401: Not verified ) It will only approve if all of the following conditions are met: the event action is completed , the workflow_run.conclusion has to be success , and the event is related to exactly one pull request (else response is 202: Ignored (event) ) the PR is authored authored by one of the users listed in allowedAuthors (line 5) (else response is 202: Ignored (pr author) ) the githubApiToken configured in line 9 needs to have repo access to the related repository (else response is 50x: some error message ) a branch protection has to be configured that requires at least one review approval and at least one status check (else response is 202: Ignored (branch protection) ) the PR has auto-merge enabled (else response is 202: Ignored (pr status) ) the PR has any failing status checks (even if not required) (else response is 202: Ignored (pr checks) ) the current value for dryRun is false (line 3) (else response is 200: Would have been approved (dryRun) ) If it approves the PR, it leaves a comment pointing to the website of this val.
Script
// if true: do all the checks but don't approve PRs (status code 200 instead of 201)
const dryRun = false;
// only PRs created by these authors will be considered
const allowedAuthors = ["renovate[bot]"];
// the secret shared with the webhook
matthiasraimann avatar
SagaImmoScraper
@matthiasraimann
Scrapes offers from SAGA This services queries from 3 PM to 5 PM all offers listed on SAGA and filters offers cheaper than 700 EUR and sends it via mail.
Script
const details = new JSDOM(detailsHTML).window.document;
const exposeURL = details.querySelector("a.bg-primary-light[rel=\"noopener noreferrer\"]")?.getAttribute("href");
const isInsideArea = await Promise.all(areas.map(async a => {
return (await distance(a.center, location).catch(() => 0)) <= a.meters;
})).then(bools => bools.some(b => b));
if (!isInsideArea) {
console.log(`Is too far off: ${exposeURL}`);
return undefined;
petermillspaugh avatar
dailySubscriptionStats
@petermillspaugh
Val Town email subscriptions: daily stats Cousin Val to @petermillspaugh/emailSubscription for emailing yourself daily subscriber stats.
Cron
/** @jsxImportSource https://esm.sh/preact */
import { email } from "https://esm.town/v/std/email?v=11";
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
import { render } from "npm:preact-render-to-string";
type SubscriberRow = [
name: string,
robsimmons avatar
aoc_2023_11_practical
@robsimmons
An interactive, runnable TypeScript val by robsimmons
Script
import { Dusa } from "https://unpkg.com/dusa@0.0.10/lib/client.js";
const INPUT = `
.trim()
…
69
…
Next