Public
yawnxyz
SidebarToArchive
HTTP
Sidebar.io Archiver Sidebar's been one of my biggest design resources for the last decade. Since sidebar.io's break announcement this morning (https://sidebar.io/break/) I've set out to mess around with using Val.town to archive sidebar.
The Google Sheet can be found here: https://docs.google.com/spreadsheets/d/1RghvMfPTR5xvHMAk1pKYuH2pFYYKOJ6bH0LLkHNZiuc/edit?usp=sharing Initially I was just piping data to Google Sheets but that's slow, wasteful and kind of dumb... instead I just wrapped Hono around the code to provide a download the CSV to browser.
1
stevekrouse
wikidata
Script
Query Wikidata via SPARQL Usage // get the death date for a person
@stevekrouse.wikidata(`SELECT ?person ?personLabel ?death_date WHERE {
?person rdfs:label "Henry Kissinger"@en;
wdt:P31 wd:Q5 . # Ensure the entity is a human
OPTIONAL {
?person wdt:P570 ?death_date . # Try to find a date of death
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}`) Learn more https://agg-shashank.medium.com/an-introduction-to-using-wikidata-apis-a678ee6d2968
0
andreterron
createGeneratedVal
Script
Use GPT to generate vals on your account! Describe the val that you need, call this function, and you'll get a new val on your workspace generated by OpenAI's API! First, ensure you have a Val Town API Token , then call @andreterron.createGeneratedVal({...}) like this example : @andreterron.createGeneratedVal({
valTownKey: @me.secrets.vt_token,
description:
"A val that given a text file position in `{line, col}` and the text contents, returns the index position",
}); This will create a val in your workspace, and here's the one created by the example above: https://www.val.town/v/andreterron.getFileIndexPosition
5
Updated: July 2, 2024