rust-nyc-discord-botApp.tsx1 match
2728try {
29const response = await fetch("/api/submissions", {
30method: "POST",
31headers: {
rust-nyc-discord-botREADME.md8 matches
22```
23โโโ backend/
24โ โโโ index.ts # Main API server with Hono
25โโโ frontend/
26โ โโโ index.html # Main HTML template
72```
7374## API Endpoints
7576- `POST /api/submissions` - Submit a new talk proposal
77- `GET /api/submissions` - Get all submissions (admin)
7879## Discord Integration Status
88**Comprehensive Logging**: The system includes detailed logging throughout the Discord integration process:
89- ๐ Environment variable checks on startup
90- ๐ฏ API request tracking with submission details
91- ๐ง Discord channel creation with API responses
92- ๐ Invite link generation with full details
93- ๐ข Organizer notifications with message content
97**Fallback behavior**: If Discord credentials are not provided, the system will use placeholder values and log what would have been done, allowing the form to still function for testing.
9899**Debugging**: Use the requests tool to view detailed logs of each submission, including all Discord API interactions and any errors that occur.
100101## Usage
108## Tech Stack
109110- **Backend**: Hono (API framework)
111- **Frontend**: React 18.2.0 with TypeScript
112- **Database**: SQLite
5657if (!response.ok) {
58throw new Error(`Reddit API error: ${response.status} ${response.statusText}`);
59}
60
reddit-checkerreddit-api-monitor.ts12 matches
1/**
2* Reddit API Monitor - Monitors subreddits using Reddit's official API
3* This script checks the Lovable subreddit for posts containing "auth" and related terms
4*/
64};
6566// Reddit API credentials
67const REDDIT_CLIENT_SECRET = 'rX_YGngVjaxRA3Y0F3STl2cuEmgHkQ';
68const REDDIT_CLIENT_ID = '151sZ8h5TaHVZGZZn0rOhA';
7273/**
74* Gets an access token from Reddit API
75*/
76async function getRedditAccessToken(): Promise<string> {
85const auth = btoa(`${REDDIT_CLIENT_ID}:${REDDIT_CLIENT_SECRET}`);
86
87const response = await fetch('https://www.reddit.com/api/v1/access_token', {
88method: 'POST',
89headers: {
115116/**
117* Fetches recent posts from a subreddit using Reddit API
118*/
119async function fetchSubredditPosts(subreddit: string, limit: number = 25): Promise<RedditPost[]> {
130131if (!response.ok) {
132throw new Error(`Reddit API error: ${response.status} ${response.statusText}`);
133}
134230async function getLastChecked(): Promise<number> {
231try {
232const data = await blob.getJSON("reddit_api_monitor_last_checked");
233return data?.timestamp || 0;
234} catch {
241*/
242async function saveLastChecked(timestamp: number): Promise<void> {
243await blob.setJSON("reddit_api_monitor_last_checked", { timestamp });
244}
245248*/
249export default async function() {
250console.log(`๐ Starting Reddit API monitor for ${CONFIG.subreddits.length} subreddits`);
251console.log(`๐ Subreddits: ${CONFIG.subreddits.map(s => `r/${s}`).join(', ')}`);
252console.log(`๐ Keywords: ${CONFIG.keywords.join(', ')}`);
320}
321322console.log(`โ Reddit API monitor completed successfully`);
323
324return {
332333} catch (error) {
334console.error('โ Reddit API monitor failed:', error);
335
336// Send error notification to Slack
346color: "danger",
347title: "Monitor Failed",
348text: `Reddit API monitor encountered an error: ${error.message}`,
349footer: "Reddit Monitor",
350ts: Math.floor(Date.now() / 1000)
projects_cms_handlermain.tsx3 matches
58// Fetch projects from the CMS
59const projectsCMS = async (): Promise<any> => {
60const API_URL = "https://cd25-projects-cms.sa-60b.workers.dev/api/cms_projects";
61debugLog("Fetching projects from CMS:", API_URL);
62try {
63const response = await fetch(API_URL, {
64method: "GET",
65headers: {
force-pushApp.tsx1 match
119<div className="flex flex-row space-x-2">
120<div>
121Val Town API key with val:write:
122</div>
123<input
force-pushpush.ts1 match
30error: true,
31message:
32"Failed to create force-push-temp branch, likely because you don't have the right permission in you api key or the branch already exists. Delete it before trying again.",
33stack: e.stack,
34};
stock_forecastindex.ts2 matches
13app.get("/shared/*", c => serveFile(c.req.path, import.meta.url));
1415// API endpoint to fetch probability data
16app.get("/api/probability", async (c) => {
17try {
18const response = await fetch("https://37ce-137-122-64-213.ngrok-free.app/predict", {
toolsfetch-ip-address.tsx1 match
1import { fetch } from "https://esm.town/v/std/fetch";
23let result = await fetch("https://api64.ipify.org?format=json");
4let json = await result.json();
5console.log(json.ip);
reactHonoStarterindex.ts2 matches
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1314// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
1617// Unwrap and rethrow Hono errors as the original error