modifyImageREADME.md1 match
1Code from https://deno.com/blog/build-image-resizing-api
23Useful for compressing an image before sending to chatgpt4v, for example
6- **Analogue Clock Schedule:** Displays daily activities in an analogue clock format with segments representing different time slots.
7- **Chore Tracker:** Lists chores for the day, with checkboxes for completion tracking.
8- **Customizable:** Accepts schedule and todoList props, allowing dynamic data from APIs or other sources.
9- **Real-time Updates:** The clock updates every second to show the current time.
10- **Responsive Design:** Styled with Tailwind CSS for a modern and clean appearance.
getLatestGitHubRunREADME.md2 matches
10TODO
11- Add handling for no runs etc
12- Handling for GitHub API limits
13- API versioning
1415Migrated from folder: examples/getLatestGitHubRun
9394export type RequestOptions = {
95apiKey?: string;
96};
9798type CampsiteAPIOptions = {
99baseUrl?: string;
100};
103104/**
105* Campsite API Client
106*/
107export class CampsiteAPI {
108private apiKey: string;
109private baseUrl: string;
110111constructor(apiKey?: string, options?: CampsiteAPIOptions) {
112this.apiKey = apiKey || Deno.env.get("CAMPSITE_API_KEY") || "";
113this.baseUrl = options?.baseUrl || "https://api.campsite.com/v2";
114}
115135const headers = {
136"Content-Type": "application/json",
137Authorization: `Bearer ${this.apiKey}`,
138};
139147const errorData = await response.json();
148console.error(errorData);
149throw new Error(`API request failed: ${response.statusText}`);
150}
151199}
200201function createCampsiteAPI(options?: RequestOptions): CampsiteAPI {
202return new CampsiteAPI(options?.apiKey);
203}
204205export async function getPost(postId: string, options?: RequestOptions) {
206const api = createCampsiteAPI(options);
207return api.getPost(postId);
208}
209212options?: RequestOptions
213) {
214const api = createCampsiteAPI(options);
215return api.createPost(data);
216}
217220options?: RequestOptions
221) {
222const api = createCampsiteAPI(options);
223return api.createComment(data);
224}
225228options?: RequestOptions
229) {
230const api = createCampsiteAPI(options);
231return api.createMessage(data);
232}
233236options?: RequestOptions
237) {
238const api = createCampsiteAPI(options);
239return api.listChannels(params);
240}
241
FetchBasicmain.tsx7 matches
6headers.set("Access-Control-Allow-Headers", "Content-Type");
78// Define the subscriber ID and API details
9const subscriberId = "sub_547dbfde-2a19-452c-9f98-bc80bcdce26c";
10const apiUrl =
11`https://api.beehiiv.com/v2/publications/pub_0928c801-3b5c-4d00-b836-fe34ae1ef82e/subscriptions/${subscriberId}`;
12const apiToken = "Kl51jIvL23ViixtZFqa3k78TWgKiLT8OZXBXju2gnef65Zfi0Y2cEoNTvFB6IqeS";
1314try {
15// Make the API request to fetch subscriber details
16const response = await fetch(apiUrl, {
17method: "GET",
18headers: {
19"Authorization": `Bearer ${apiToken}`,
20"Content-Type": "application/json",
21},
FetchBasicREADME.md1 match
1# Framer Fetch: Basic
23A basic example of an API endpoint to use with Framer Fetch.
1# Framer Fetch: Basic
23A basic example of an API endpoint to use with Framer Fetch.
891. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
simpletypemain.tsx1 match
26const fetchWords = useCallback(async () => {
27try {
28const response = await fetch("https://random-word-api.herokuapp.com/all");
29if (!response.ok) {
30throw new Error("Failed to fetch words");
blob_adminREADME.md1 match
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1213It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1415# TODO