Back to APIs list

Twitter API examples & templates

Use these vals as a playground to view and fork Twitter API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
ikbear avatar
ikbear
Bio
HTTP
Forked from stevekrouse/linkInBioTemplate
0
jxnblk avatar
jxnblk
color_contrast
HTTP
Forked from jxnblk/head
5
jxnblk avatar
jxnblk
JxnblkApp
Script
React components for https://val.town/v/jxnblk/dotcom – https://jxnblk.com
0
daisuke avatar
daisuke
linkInBioTemplate
HTTP
Forked from stevekrouse/linkInBioTemplate
0
ajax avatar
ajax
resume
Script
// set by ajax.resumeHtml at 2023-06-07T20:30:59.005Z
0
petermillspaugh avatar
petermillspaugh
june2024
Script
@jsxImportSource https://esm.sh/preact
0
michaelfromyeg avatar
michaelfromyeg
notion2wallabag
HTTP
Notion2Wallabag Intended to be run with Notion's webhooks. When fired, tries to save a Notion database item with a "Link" property to a Wallabag instance. Cannot be re-used for other workspaces, since it requires various Wallabag secrets and a Notion-specific token. Feel free to fork!
0
websrai avatar
websrai
legalAssistant
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
jxnblk avatar
jxnblk
indirection
HTTP
A game of riddles to play with your friends How to play To start a game, choose a 3-20 letter word. The game generates a riddle based on your word. Copy the link to share with your friends to see if they can guess the word. If they guess the word correctly, they get to pick a new word and can send you a new clue back. If they guess wrong, the next riddle is based on the word they guessed You can play with 2 or as many people as you want. You can follow a long chain, like the game Telephone or games can branch with multiple players. TODO [ ] Reload after updating the URL to support native share sheets [ ] Incorrect state / helpers [x] Trim and lowercase guesses
0
ericlee4 avatar
ericlee4
eclipseStreamData
HTTP
List of Risk of Rain 2 eclipse streamers Data updated every 15 minutes viewerCount is the highest viewer count detected for the last stream Detects the tags "Eclipse" and "E8" in the title and tags (case insensitive)
1
bmitchinson avatar
bmitchinson
GameAwards2024PredictionGame
HTTP
@jsxImportSource https://esm.sh/react
0
samhashemi avatar
samhashemi
testing
HTTP
Forked from stevekrouse/twitterJSON
1
prashamtrivedi avatar
prashamtrivedi
ThankYouNoteGenerator
HTTP
Forked from willthereader/ThankYouNoteGenerator
0
yawnxyz avatar
yawnxyz
deletebio
HTTP
// at ms2, we're collecting mge vs. bacteria data over time, to build models that help us create, read, update, and delete bacteria from anywhere.
0
mttlws avatar
mttlws
TodayForAnnalisa
Express (deprecated)
An interactive, runnable TypeScript val by mttlws
1
stevekrouse avatar
stevekrouse
newStripeSubscriber
HTTP
New Stripe Subscription Handler This val processes new Stripe subscribers to Val Town Pro. It sends our team a Discord notifcation and sends a welcome email to the new subscriber. It takes a couple of steps if you'd like to set up something similar for your own Stripe account. Setup Fork this HTTP val Create a new webhook in Stripe Add your val's HTTP endpoint URL into the Stripe webhook Select customer.subscription.updated as the only event to listen to (more on this below) Add your stripe_sk_customer_readonly to your Val Town Env Variables Add your webhook's signing secret as STRIPE_WEBHOOK_SECRET to you Val Town Env Variables How the code is structured Verifies the signature to make sure it's really from Stripe Filters out only newly created subscriptions Sends off the Discord message & email Which Stripe event type to listen to Stripe sends webhooks for many different kinds of events. Relevant for us here are: customer.subscription.created (what we used to listen for) customer.subscription.updated (what we're currently listening for) The issue with customer.subscription.created is that it triggers too early, before the user's payment actually goes through. This is a problem because in early Nov 2024 we started getting credit card fraudsters testing cards using our service. We started getting lots of notifications for new subscriptions that never actually became active. Note: if anyone knows good ways to prevent that sort of behavior at the root, please let me know by commenting on this val! In order to only get notified on a valid subscription, we now subscribe to customer.subscription.updated . This event happens on any subscription change, including renewals and cancellations, so now we have to filter those events to only get new subscriptions, ie where: event.data.previous_attributes.status === 'incomplete' && event.data.object.status === 'active'
2