bsky_phrase_trackerREADME.md1 match
7273Built using:
74- [atproto/api](https://www.npmjs.com/package/@atproto/api) for Bluesky integration
75- [Val Town](https://val.town) for hosting and scheduling
OpenTownieREADME.md3 matches
10## Getting Started
11121. Create a [Val Town API token](https://www.val.town/settings/api) with Val read and write permissions
132. Paste the token into the input box and get started
1415## Forking the Project
1617You'll need to get an **Open Router API key**.
18We choose Open Router so we could easily switch between
19all models. We soon want to make it so you can choose your
20model from a dropdown, but we're having trouble formatting the api calls such that they work on all providers. Maybe we need to switch to the vercel sdk
OpenTowniesystem_prompt.txt2 matches
26* DO NOT use the alert(), prompt(), or confirm() methods.
2728* If the user's app needs weather data, use open-meteo unless otherwise specified because it doesn't require any API keys.
2930* Tastefully add a view source link back to the user's val if there's a natural spot for it. Generate the val source url via `import.meta.url.replace("esm.town", "val.town")`. This link element should include a target="_top" attribute.
38Val Town's client-side catch script automatically catches client-side errors to aid in debugging.
3940* Don't use any environment variables unless strictly necessary. For example use APIs that don't require a key.
41If you need environment variables use `Deno.env.get('keyname')`
42
OpenTowniegenerateCode2 matches
2930const openai = new OpenAI({
31baseURL: "https://openrouter.ai/api/v1",
32apiKey: Deno.env.get("OPEN_ROUTER_KEY"),
33});
34console.log(messages);
ThumbMakermain.tsx1 match
2* This application creates a thumbnail maker using Hono for server-side routing and client-side JavaScript for image processing.
3* It allows users to upload images, specify output options, and generate a composite thumbnail image.
4* The app uses the HTML5 Canvas API for image manipulation and supports drag-and-drop functionality.
5*
6* The process is divided into two steps:
createWebsitemain.tsx5 matches
45// Utility Functions
6const API_BASE_URL = 'https://api.example.com';
78// Components
68e.preventDefault();
69try {
70const response = await fetch(`${API_BASE_URL}/login`, {
71method: 'POST',
72headers: { 'Content-Type': 'application/json' },
121122try {
123const response = await fetch(`${API_BASE_URL}/signup`, {
124method: 'POST',
125headers: { 'Content-Type': 'application/json' },
181182try {
183const response = await fetch(`${API_BASE_URL}/upload`, {
184method: 'POST',
185body: formData
215216try {
217const response = await fetch(`${API_BASE_URL}/chat`, {
218method: 'POST',
219headers: { 'Content-Type': 'application/json' },
competentOlivePeacockmain.tsx9 matches
58const fetchContent = async () => {
59try {
60const response = await fetch("/api/content");
61const data = await response.json();
62if (data.records) {
99const analyzeContent = async (item: AirtableRecord) => {
100try {
101const response = await fetch("/api/analyze", {
102method: "POST",
103headers: {
238const url = new URL(req.url);
239240if (url.pathname === "/api/content") {
241const apiToken = Deno.env.get("VITE_AIRTABLE_API_KEY");
242const baseId = Deno.env.get("VITE_AIRTABLE_BASE_ID");
243const tableId = Deno.env.get("VITE_AIRTABLE_TABLE_ID");
244245if (!apiToken || !baseId || !tableId) {
246return new Response(JSON.stringify({ error: "Missing environment variables" }), {
247status: 500,
250}
251252const airtableUrl = `https://api.airtable.com/v0/${baseId}/${tableId}`;
253254const headers = new Headers({
255"Authorization": `Bearer ${apiToken}`,
256"Content-Type": "application/json",
257"Access-Control-Allow-Origin": "*",
267const response = await fetch(airtableUrl, {
268headers: {
269"Authorization": `Bearer ${apiToken}`,
270"Content-Type": "application/json",
271},
285});
286}
287} else if (url.pathname === "/api/analyze") {
288if (req.method === "POST") {
289const { OpenAI } = await import("https://esm.town/v/std/openai");
githubParsermain.tsx16 matches
96<h1>GitHub Repository Parser</h1>
97<p class="pb-4">Parse and analyze GitHub repositories.</p>
98<p class="pb-4">Sometimes GitHub will block your request (e.g. respond with "forbidden"), in which case you'll just have to try again later. Or clone this project and use your own API key ;)</p>
99<form id="repoForm" class="mb-4">
100<input type="text" id="repoUrl" value="https://github.com/elder-plinius/L1B3RT45" placeholder="Enter GitHub repository URL"
589async function fetchRepositoryContent(owner, repo, specifiedBranch = null, ignoredPatterns, selectedTypes = null) {
590// First, try to get the default branch or use the specified branch
591const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
592const repoInfoResponse = await fetch(repoInfoUrl, {
593headers: {
594'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
595'Accept': 'application/vnd.github.v3+json'
596}
607const defaultBranch = specifiedBranch || repoInfo.default_branch;
608609const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recursive=1`;
610const response = await fetch(apiUrl, {
611headers: {
612'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
613'Accept': 'application/vnd.github.v3+json'
614}
619throw new Error(`Failed to fetch repository content. The ${defaultBranch} branch might not exist.`);
620}
621throw new Error(`GitHub API request failed: ${response.statusText}`);
622}
623662663async function fetchFileContent(owner, repo, path, branch) {
664const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
665const response = await fetch(apiUrl, {
666headers: {
667'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
668'Accept': 'application/vnd.github.v3+json'
669}
821// Add new function to get repository file types
822async function getRepositoryFileTypes(owner, repo, specifiedBranch = null) {
823const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
824const repoInfoResponse = await fetch(repoInfoUrl, {
825headers: {
826'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
827'Accept': 'application/vnd.github.v3+json'
828}
836const defaultBranch = specifiedBranch || repoInfo.default_branch;
837
838const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recursive=1`;
839const response = await fetch(apiUrl, {
840headers: {
841'Authorization': `token ${Deno.env.get("GITHUB_API_KEY")}`,
842'Accept': 'application/vnd.github.v3+json'
843}
845
846if (!response.ok) {
847throw new Error(`GitHub API request failed: ${response.statusText}`);
848}
849
6// main controller function
7export default async function(receivedEmail) {
8const apiKey = Deno.env.get("FIREWORKS_API_KEY");
9const model = "accounts/fireworks/models/deepseek-r1";
1011if (!apiKey) {
12throw new Error(
13"FIREWORKS_API_KEY environment variable is not set. Please set it or replace this line with your API key.",
14);
15}
3738// step 4: send prompt to Fireworks.ai
39const aiResponse = await sendRequestToFireworks(prompt, apiKey, model);
4041// step 5: parse the AI response
132133// helper function to send a request to Fireworks.ai
134async function sendRequestToFireworks(prompt, apiKey, model) {
135try {
136const client = new OpenAI({
137baseURL: "https://api.fireworks.ai/inference/v1",
138apiKey: apiKey,
139});
140160return message;
161} catch (error) {
162console.error("Fireworks.ai API Error:", error);
163return `Error: ${error.message}`;
164}
92<title>RIKKAEBI</title>
93<script src="https://cdn.tailwindcss.com"></script>
94<link rel="preconnect" href="https://fonts.googleapis.com">
95<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
96<link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap" rel="stylesheet">
97<meta name="viewport" content="width=device-width, initial-scale=1">
98</head>