50## How it works
51
52Telegram has a lovely API.
53
541. I created a @ValTownBot via [Bot Father](https://t.me/botfather).
552. I created a [webhook](https://www.val.town/v/stevekrouse.telegramValTownBotWebhook) and [registered it with telegram](https://www.val.town/v/stevekrouse.telegramValTownBotWebhookSetup)
563. Whenever someone new messages @ValTownBot, I generate a secret and save it along with their Chat Id in @stevekrouse/telegramValTownBotSecrets (a private val), and message it back to them
574. Now whenever you call this val, it calls [`telegramValTownAPI`](https://www.val.town/v/stevekrouse.telegramValTownAPI), which looks up your Chat Id via your secret and sends you a message
58
59## Telegram Resources
71
72- [ ] Store user data in Val Town SQLite
73- [ ] Parse user data on the API side using Zod
74
75Migrated from folder: External_APIs/telegram/telegram
1A wrapper for OpenAI's DALLE API. See the API reference here: https://platform.openai.com/docs/api-reference/images/create?lang=curl
1A quick method to derive the ATProto PLC from a domain using Cloudflare's 1.1.1.1 service.
2
3Use as an API with val.town's usual URL structure: eg. https://api.val.town/v1/run/byjp.atproto?args=%5B%22byjp.me%22%5D
4
5Migrated from folder: ATProto/atproto
5Using these two vals, you can put an interactive guestbook on any website.
6
7`valUser` and `valName` are used to build the Express API URL for your forked version of [`@vtdocs.guestbook`](https://www.val.town/v/vtdocs.guestbook).
1# Shortlinks for the decentralised web
2
3This is a script to allow API-based updating of the shortlinks/redirects in an IPFS-based shortlink repo (using val.town). I've written up how all this works on my blog at https://byjp.me/posts/link-shortener
4
5Migrated from folder: Shortlink/addShortlink
1https://api.val.town/v6/run/rd3m.hiddenApi?args=["rd3m"]
4
5You'll need
61. Figma **API token**: Read the instructions [here](https://www.figma.com/developers/api#access-tokens).
72. **Figma file ID**: Find it in the file URL. For example: *figma.com/file/**29f4m6rsDtsUofYxK329r9**/fileName?...*
8
1# Poll Twitter & Populate SQlite database
2
3The twitter API (or in this case someone else's wrapper over the twitter API) is finicky, so we just try to get one handle per minute, and shove whatever we get into our database, which could be an error message (this is why handles don't have a unique index).
4
5Migrated from folder: Archive/turso/twitterFollows/populateTwitterDB
1# [Generate a Val](https://andreterron-genval.express.val.run)
2
3Uses the OpenAI API to generate code for a val based on the description given by the user.
4
5TODO:
1# [The Big Story](https://tmcw-big_story_visualization.express.val.run/)
2
3This val, along with [@tmcw.big_story](https://www.val.town/v/tmcw.big_story), which requests from the [New York Times API](https://developer.nytimes.com/), and [@tmcw.big_stories_ranks](https://www.val.town/v/tmcw.big_stories_ranks), which contains the data, generates a visualization of top stories on the NYTimes homepage.
4
5This is here just to ask the question β what happens to cover stories over time? Do they slowly drop down the page, or just get replaced by a fully new lede? So far it doesn't have quite enough data to answer that question.