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.
andreterron avatar
twitterRequestAccessToken
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
stevekrouse avatar
exampleTwitterSearch
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
andreterron avatar
searchPostsForTheActuallyBot
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
stevekrouse avatar
linkInBioTemplate
@stevekrouse
HTTP (deprecated)
@jsxImportSource https://esm.sh/react
andreterron avatar
refreshTwitterToken
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
steven avatar
getSeattleSubwayTweets
@steven
HTTP (deprecated)
An interactive, runnable TypeScript val by steven
stevekrouse avatar
twitterFollowingsMigrations
@stevekrouse
Script
Example Hosted SQLite on Turso Creates a database of twitter users and followers Requires tursoURL and tursoToken in your secrets. It references @stevekrouse.stevekrouseFollowing to get a list of all the twitter IDs of the users I follow on twitter and insert them to the users table and the followings table as people I follow. @stevekrouse.populateTwitterDB is a poll job that runs every minute and tries to populate this table with the twitter handles of these users.
guidoism avatar
hackerNewsAuthors
@guidoism
Script
An interactive, runnable TypeScript val by guidoism
stevekrouse avatar
crimsonLynx
@stevekrouse
HTTP (deprecated)
Forked from willthereader/personalWebsite
tylergaw avatar
socialImage
@tylergaw
HTTP (deprecated)
Simple image generator A bit of a toy image creator that can be used anywhere images can be, but is intended for social share images in og:image or twitter:image meta tags. Usage examples In a live web page Live example https://tylergaw-socialimageusage.web.val.run/ Live example Val https://www.val.town/v/tylergaw.socialImageUsage Code examples Default This will set the og:image of a web page to a png image of an orange 1200x600 pixel rectangle <meta property="og:image" content="https://tylergaw-socialimage.web.val.run/"> Works the same way as an embedded image <img src="https://tylergaw-socialimage.web.val.run/"> Customize with query parameters General note, some clients are more permissive with unencoded query params than others. It's best to encodeURIComponent for all params. Available params: bg : Sets the background color. Default orange . See Color format examples below for details color : Sets the background color. Default black . See Color format examples below for details w : Sets the width of the image. Default 1200 h : Sets the height of the image. Default 600 text : Sets the text displayed. Default Wellow horld <meta property="og:image" content="https://tylergaw-socialimage.web.val.run/?bg=pink&w=1000&h=400"> Color format examples bg and color parameters can any valid color that works with canvas fillStyle in hex, rgb(a), hsl(a), rrggbbaa, etc format. Note # must be encoded. Hex ?bg=%235f0ac7 rgb(a) ?bg=rgba(100,200,85,0.5) rrggbbaa ?bg=%23ff0095d1 hsl(a) ?bg=hsla(100,100%25,50%25,0.5)
rodrigotello avatar
valTownInspoList
@rodrigotello
Script
Val Town inspiration & use cases list List [as object] used in Val Town's use cases and inspiration. Check it out at in /examples/use-cases and /docs/tutorial/4
substrate avatar
hackerNewsRAG
@substrate
HTTP (deprecated)
Forked from substrate/similarSites
paulhoule avatar
hackerNewsRAG
@paulhoule
HTTP (deprecated)
Forked from substrate/hackerNewsRAG
willthereader avatar
honoExample
@willthereader
HTTP (deprecated)
Forked from maxm/honoExample
jacoblee93 avatar
runAgent
@jacoblee93
Script
An interactive, runnable TypeScript val by jacoblee93
fil avatar
cron_rezo_rss2bsky
@fil
Cron
Passerelle RSS vers BlueSky Ce script tourne une fois par heure et reposte les news de https://rezo.net/ vers le compte https://bsky.app/profile/rezo.net Il utilise 3 éléments: l'URL du flux RSS une variable de stockage de l'état, qu'il faut créer initialement comme let storage_rss_rezo = {} et qui sera mise à jour par le script les secrets du compte (username et mot de passe de l'application) Il appelle @me.bsky_rss_poll qui lit le flux, vérifie avec l'état s'il y a du nouveau, et au besoin nettoie le post, puis l'envoie avec le script @me.post_to_bsky . Sans oublier de mettre à jour l'état pour le prochain run. C'est un premier jet. Merci à @steve.krouse pour val.town et à @jordan pour ses scripts que j'ai bidouillés ici. À faire éventuellement: améliorer la logique; poster vers twitter .