exclusiveGoldArmadilloREADME.md4 matches
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
3233### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
6061### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
6364- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
GitHubSyncREADME.md3 matches
24- Ensure the token has read/write access to _Contents_ for the repo
25- Copy the access token and add that as the `GITHUB_TOKEN` env var in this val
261. Add a new [Val Town API token][] with read/write permissions. Add that token to the val's env vars as `VALTOWN_TOKEN`
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
286869- `GITHUB_TOKEN`: Read/write GitHub personal access token for reading and writing repo contents
70- `VALTOWN_TOKEN`: ValTown API token (with read/write Vals permissions) for writing updates from GitHub
71- `GITHUB_WEBHOOK_SECRET`: secret for verifying webhooks from GitHub
72- `VAL_SECRET`: secret for verifying requests to the `/push` endpoint
98[github oauth app]: https://github.com/settings/developers
99[access token]: https://github.com/settings/tokens
100[val town api token]: https://www.val.town/settings/api
101[troubleshooting]: #troubleshooting
102
newStripeSubscribermain.tsx1 match
34const stripe = new Stripe(Deno.env.get("stripe_sk_customer_readonly") as string, {
5apiVersion: "2020-08-27",
6});
7
7* Optimisitically types the values we expect in our environment and context:
8*
9* - `Bindings` determines env vars, accessed via `c.env.NAME_OF_VAR` in api handlers
10* - `Variables` determines context vars, accessed via `c.get("NAME_OF_VAR")` in api handlers
11*/
12export type AppType = {
3This is a template for a [HONC](https://honc.dev) project inside ValTown. You should just be able to fork it and get going. It uses:
45- Hono for the API
6- Drizzle for the ORM
7- ValTown sqlite for the DB
8- ValTown as the Cloud
9- Fiberplane as the API Explorer
1011There's a list of example HONC apps for inspiration on GitHub: [here](https://github.com/fiberplane/awesome-honc) and [here](https://github.com/fiberplane/create-honc-app/tree/main/examples)
1import { createFiberplane, createOpenAPISpec } from "./deps/fiberplane.ts";
2import { Hono, HTTPException } from "./deps/hono.ts";
34import homePage from "./app/home.tsx";
5import type { AppType } from "./app/types.ts";
6import usersApi from "./app/users.ts";
7import { db } from "./db/client.ts";
8import { migrateDatabase } from "./db/migrate.ts";
22});
2324/** Mount the user management API at `/api/users` */
25app.route("/api/users", usersApi);
2627/** Render a Home page (example of using Hono with JSX) */
28app.route("/", homePage);
2930/** Create a simplified openapi spec that just lists the routes in our app */
31app.get("/openapi.json", async c => {
32return c.json(
33createOpenAPISpec(app, {
34openapi: "3.0.0",
35info: {
36title: "Honc D1 App",
4243/**
44* Mount the Fiberplane api playground
45* Visit /fp to view the UI
46*/
48"/fp/*",
49createFiberplane({
50openapi: { url: "/openapi.json" },
51}),
52);
63/**
64* Wrap the incoming request, inject the Deno env vars into the Hono app,
65* and then call the Hono api entrypoint (`app.fetch`)
66*/
67export default async function(req: Request): Promise<Response> {
68const env = Deno.env.toObject();
69// NOTE - Adding the entire env object will also expose the following values to your api handlers:
70//
71// * `valtown`
72// * `VAL_TOWN_API_KEY`
73// * `VALTOWN_API_URL`
74//
75// If you don't want those values, remove them from the env object
37</head>
38<body class={bodyStyles}>
39<h1>🪿 Welcome to my HONC API! 🪿</h1>
40<p>
41Visit <a href="/fp" class={linkStyles}>/fp</a> to view the Fiberplane API explorer.
42</p>
43</body>
HONCfiberplane.ts2 matches
1import { createFiberplane, createOpenAPISpec } from "https://esm.sh/@fiberplane/hono@0.4.4";
23export { createFiberplane, createOpenAPISpec };
37</head>
38<body class={bodyStyles}>
39<h1>🪿 Welcome to my HONC API! 🪿</h1>
40<p>
41Visit <a href="/fp" class={linkStyles}>/fp</a> to view the Fiberplane API explorer.
42</p>
43</body>
telegramBotStarterindex.ts1 match
30// This is a no-op if nothing's changed
31if (!isEndpointSet) {
32await bot.api.setWebhook(req.url, {
33secret_token: SECRET_TOKEN,
34});