WillpersonalWebsitehomepage1 match
137app.get("/ImOKTheBullIsDead", ImOKTheBullIsDead);
138139export default app.fetch;
46app.get("/ImOKTheBullIsDead", ImOKTheBullIsDead);
4748export default app.fetch;
reactHonoStarterkkindex.ts2 matches
21});
2223// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
reactHonoStarteindex.ts2 matches
21});
2223// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
reactHonoStarterindex.ts2 matches
21});
2223// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
factoid-triviaindex.ts1 match
244});
245246export default app.fetch;
247
factoid-triviaApp.tsx19 matches
46}, []);
4748const fetchGameState = async () => {
49try {
50const response = await fetch("/api/game-state");
51if (response.ok) {
52const newGameState = await response.json();
64}
65} catch (err) {
66console.error("Failed to fetch game state:", err);
67}
68};
70const startPolling = () => {
71if (pollIntervalRef.current) return;
72pollIntervalRef.current = setInterval(fetchGameState, 2000); // Poll every 2 seconds
73};
748586try {
87const response = await fetch("/api/join", {
88method: "POST",
89headers: { "Content-Type": "application/json" },
118119try {
120const response = await fetch("/api/submit-fact", {
121method: "POST",
122headers: { "Content-Type": "application/json" },
127128if (response.ok) {
129await fetchGameState(); // Refresh game state
130} else {
131setError(data.error || "Failed to submit fact");
144145try {
146const response = await fetch("/api/start-round", {
147method: "POST",
148headers: { "Content-Type": "application/json" },
152153if (response.ok) {
154await fetchGameState(); // Refresh game state
155} else {
156setError(data.error || "Failed to start round");
171172try {
173const response = await fetch("/api/vote", {
174method: "POST",
175headers: { "Content-Type": "application/json" },
184185if (response.ok) {
186await fetchGameState(); // Refresh game state
187} else {
188setError(data.error || "Failed to cast vote");
200201try {
202const response = await fetch("/api/reveal", {
203method: "POST",
204headers: { "Content-Type": "application/json" },
208209if (response.ok) {
210await fetchGameState(); // Refresh game state
211} else {
212setError(data.error || "Failed to reveal answers");
222223try {
224const response = await fetch("/api/skip", {
225method: "POST",
226headers: { "Content-Type": "application/json" },
230231if (response.ok) {
232await fetchGameState(); // Refresh game state
233} else {
234setError(data.error || "Failed to skip round");
244245try {
246await fetch("/api/leave", {
247method: "POST",
248headers: { "Content-Type": "application/json" },
253setUserVote(null);
254stopPolling();
255await fetchGameState();
256} catch (err) {
257console.error("Leave error:", err);
272273try {
274const response = await fetch("/api/admin/kick-all", {
275method: "POST",
276headers: { "Content-Type": "application/json" },
286287// Refresh game state
288await fetchGameState();
289290alert("All players have been kicked and game data cleared.");
factoid-trivia.instructions.md3 matches
239
240// Inject data to avoid extra round-trips
241const initialData = await fetchInitialData();
242const dataScript = `<script>
243window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
2862875. **API Design:**
288- `fetch` handler is the entry point for HTTP vals
289- Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
290291
reddit-checkerREADME.md4 matches
170### Adjusting Post Limit
171172Modify the `limit` parameter in the `fetchSubredditPosts` function call:
173174```typescript
175const posts = await fetchSubredditPosts(subreddit, 50); // Check 50 posts per subreddit instead of 25
176```
177187188- โ Reddit API authentication working
189- โ Post fetching functional across multiple subreddits
190- โ Keyword matching operational
191- โ Slack notifications configured and tested
225- **API Connection**: โ Successful
226- **Authentication**: โ Working
227- **Post Fetching**: โ Retrieved posts from multiple subreddits
228- **Keyword Matching**: โ Found matches with updated keyword list
229- **Multi-Subreddit Support**: โ Now monitoring 11 subreddits simultaneously
reddit-checkerreddit-api-monitor.ts11 matches
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[]> {
120try {
121const accessToken = await getRedditAccessToken();
122const url = `https://oauth.reddit.com/r/${subreddit}/new?limit=${limit}`;
123
124const response = await fetch(url, {
125headers: {
126'Authorization': `Bearer ${accessToken}`,
136return data.data.children.map(child => child.data);
137} catch (error) {
138console.error(`Error fetching posts from r/${subreddit}:`, error);
139throw error;
140}
212};
213214const response = await fetch(SLACK_WEBHOOK_URL, {
215method: 'POST',
216headers: {
267
268try {
269// Fetch recent posts from this subreddit
270const posts = await fetchSubredditPosts(subreddit);
271console.log(`๐ฅ Fetched ${posts.length} posts from r/${subreddit}`);
272totalPosts += posts.length;
273302303console.log(`\n๐ Summary across all subreddits:`);
304console.log(`๐ฅ Total posts fetched: ${totalPosts}`);
305console.log(`๐ Total new posts: ${totalNewPosts}`);
306console.log(`โ Total matches found: ${allMatchingPosts.length}`);
336// Send error notification to Slack
337try {
338await fetch(SLACK_WEBHOOK_URL, {
339method: 'POST',
340headers: {