reddit-checkerREADME.md10 matches
67- **Unified Monitoring**: Single script handles all Reddit monitoring
8- **Multiple Methods**: Uses Reddit API with JSON and RSS fallbacks for reliability
9- **Multi-Subreddit Support**: Monitors 11 subreddits simultaneously
10- **Dual Notifications**: Sends both Slack and email notifications
72- **Execution**: Automated cron scheduling + manual override capability
7374### Reddit API Credentials โ CONFIGURED
7576- **Client ID**: `151sZ8h5TaHVZGZZn0rOhA`
137- **Frequency**: Automated cron execution + manual override capability
138- **Scope**: New posts since last check across all monitored subreddits
139- **Methods**: Reddit API (primary), JSON API (fallback), RSS feeds (last resort)
140141### Keyword Matching โ TESTED
192## ๐ Security
193194- Reddit API credentials are configured and working
195- Access tokens are cached and automatically refreshed
196- All API calls use proper authentication headers
197- Fallback methods ensure reliability even if primary API fails
198199## โ System Status
205- โ **Automated Scheduling**: Runs consistently on cron schedule
206- โ **Manual Override**: Can still be run manually when needed
207- โ **Multi-Method Fetching**: Reddit API โ JSON API โ RSS fallbacks
208- โ **Multi-Subreddit Support**: 11 subreddits monitored simultaneously
209- โ **Triple Output**: Slack notifications + Email alerts + Database storage
233- Use `?action=reset` to check all posts again
2342352. **API Errors**
236- The script automatically falls back to JSON API then RSS
237- Check the response for detailed error information
238245246The unified script provides comprehensive logging:
247- Shows which method was used for each subreddit (API/JSON/RSS)
248- Reports errors per subreddit but continues with others
249- Provides detailed match information
1import { setTimeout } from "node:timers/promises";
23const articles = [{
4id: 0,
5title: "A Crash Course in GraphQL",
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
enchantingBeigeFireflymain.tsx2 matches
2627// Get weather for the current position
28const apiKey = "28b7fee1c3078108ffb899013952f3e5"; // Replace with actual API key
29const weatherUrl =
30`https://api.openweathermap.org/data/2.5/weather?lat=${position.latitude}&lon=${position.longitude}&units=metric&appid=${apiKey}`;
3132try {
10app.get("/public/**/*", c => serveFile(c.req.path, import.meta.url));
1112const { accountId: ACCOUNT_ID, apiKey: API_KEY } = process.env;
1314const authorizeWithKlarna = async (
19) => {
20const response = await fetch(
21`https://api-global.test.klarna.com/v2/accounts/${ACCOUNT_ID}/payment/authorize`,
22{
23method: "POST",
25"Content-Type": "application/json",
26"Klarna-Interoperability-Token": interoperabilityToken,
27Authorization: "Basic " + API_KEY,
28},
29body: JSON.stringify({
57const getKlarnaSDKToken = async (interoperabilityToken) => {
58const response = await fetch(
59`https://api-global.test.klarna.com/v2/accounts/${ACCOUNT_ID}/interoperability/sdk-tokens`,
60{
61method: "POST",
63"Content-Type": "application/json",
64"Klarna-Interoperability-Token": interoperabilityToken,
65Authorization: "Basic " + API_KEY,
66},
67},
154});
155156// Add your API routes here
157// app.get("/api/data", c => c.json({ hello: "world" }));
158159// Unwrap and rethrow Hono errors as the original error
13app.get("/public/**/*", c => serveFile(c.req.path, import.meta.url));
1415// Add your API routes here
16// app.get("/api/data", c => c.json({ hello: "world" }));
1718// Unwrap and rethrow Hono errors as the original error
37app.get("/paymentRequest", async function(c) {
38const { amount, currency, returnUrl } = c.req.query();
39const apiKey = process.env.API_KEY;
4041const response = await fetch(
42`https://api-global.test.klarna.com/v2/payment/requests`,
43{
44method: "POST",
45headers: {
46"Content-Type": "application/json",
47Authorization: "Basic " + apiKey,
48},
49body: JSON.stringify({
rust-nyc-discord-botindex.ts32 matches
72});
7374// API Routes
75app.post("/api/submissions", async c => {
76console.log(`๐ฏ [API] New talk submission received`);
7778try {
80const { speakerName, talkContext, isOnBehalf, submitterName } = body;
8182console.log(`๐ [API] Submission details:`);
83console.log(` Speaker: "${speakerName}"`);
84console.log(` Context length: ${talkContext?.length || 0} characters`);
90// Validate input
91if (!speakerName || !talkContext || typeof isOnBehalf !== "boolean") {
92console.error(`โ [API] Validation failed - missing required fields`);
93console.error(` speakerName: ${!!speakerName}`);
94console.error(` talkContext: ${!!talkContext}`);
99// Validate submitter name if submitting on behalf
100if (isOnBehalf && !submitterName?.trim()) {
101console.error(`โ [API] Validation failed - submitter name required when submitting on behalf`);
102return c.json({ error: "Submitter name is required when submitting on behalf of someone else" }, 400);
103}
104105console.log(`๐พ [API] Inserting submission into database`);
106107// Insert submission into database
112113const submissionId = Number(result.lastInsertRowid);
114console.log(`โ [API] Database insertion successful, submission ID: ${submissionId}`);
115116// Discord integration workflow
117console.log(`๐ค [API] Starting Discord integration workflow`);
118119console.log(`๐ง [API] Step 1: Creating Discord channel`);
120const discordChannelId = await createDiscordChannel(speakerName, submissionId);
121122console.log(`๐ [API] Step 2: Creating Discord invite`);
123const discordInviteLink = await createDiscordInvite(discordChannelId);
124125console.log(`๐ข [API] Step 3: Notifying organizers`);
126await postToOrganizersChannel(speakerName, talkContext, isOnBehalf, submitterName, discordChannelId);
127128console.log(`๐พ [API] Updating database with Discord information`);
129130// Update submission with Discord info
134);
135136console.log(`โ [API] Submission processing complete!`);
137console.log(`๐ [API] Final result:`);
138console.log(` Submission ID: ${submissionId}`);
139console.log(` Discord Channel ID: ${discordChannelId}`);
146});
147} catch (error) {
148console.error(`๐ฅ [API] Critical error processing submission:`, error);
149console.error(`๐ฅ [API] Error type:`, error.constructor.name);
150console.error(`๐ฅ [API] Error message:`, error.message);
151if (error.stack) {
152console.error(`๐ฅ [API] Stack trace:`, error.stack);
153}
154return c.json({ error: "Internal server error" }, 500);
157158// Get all submissions (for admin view)
159app.get("/api/submissions", async c => {
160try {
161const submissions = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY created_at DESC`);
207}
208209console.log(`๐ [Discord] Making API request to create channel in guild ${guildId}`);
210console.log(`๐ [Discord] Channel data:`, JSON.stringify(channelData, null, 2));
211212const response = await fetch(`https://discord.com/api/v10/guilds/${guildId}/channels`, {
213method: "POST",
214headers: {
219});
220221console.log(`๐ก [Discord] API Response Status: ${response.status} ${response.statusText}`);
222223if (!response.ok) {
233}
234235throw new Error(`Discord API error: ${response.status} - ${errorText}`);
236}
237275};
276277console.log(`๐ [Discord] Making API request to create invite for channel ${channelId}`);
278console.log(`๐ [Discord] Invite data:`, JSON.stringify(inviteData, null, 2));
279280const response = await fetch(`https://discord.com/api/v10/channels/${channelId}/invites`, {
281method: "POST",
282headers: {
287});
288289console.log(`๐ก [Discord] Invite API Response Status: ${response.status} ${response.statusText}`);
290291if (!response.ok) {
301}
302303throw new Error(`Discord API error: ${response.status} - ${errorText}`);
304}
305375};
376377console.log(`๐ [Discord] Making API request to post to organizers channel ${organizersChannelId}`);
378console.log(`๐ [Discord] Message data:`, JSON.stringify(messageData, null, 2));
379380const response = await fetch(`https://discord.com/api/v10/channels/${organizersChannelId}/messages`, {
381method: "POST",
382headers: {
387});
388389console.log(`๐ก [Discord] Message API Response Status: ${response.status} ${response.statusText}`);
390391if (!response.ok) {
410}
411412throw new Error(`Discord API error: ${response.status} - ${errorText}`);
413}
414
Linear-Slack-Pingdeployment-guide.md6 matches
7Copy each TypeScript file into a new Val:
891. **linearApi** - Copy contents of `linearApi.ts`
102. **slackApi** - Copy contents of `slackApi.ts`
113. **database** - Copy contents of `database.ts`
124. **slashCommand** - Copy contents of `slashCommand.ts`
21```typescript
22// Change from:
23import { getLinearTicket } from "./linearApi";
2425// To:
26import { getLinearTicket } from "https://esm.town/v/YOUR_USERNAME/linearApi";
27```
283031In Val Town settings, add:
32- `LINEAR_API_KEY`
33- `SLACK_BOT_TOKEN`
3456## Troubleshooting
5758- **"Failed to fetch Linear ticket"**: Check your LINEAR_API_KEY
59- **"Failed to lookup user"**: Check SLACK_BOT_TOKEN permissions
60- **Modal doesn't open**: Verify interactivity URL is correct
43console.log({ presentationResponse });
4445const buttonAPI = presentationResponse.paymentButton;
4647const buttonConfig = {
63};
6465const klarnaButton = buttonAPI.component(buttonConfig).mount("#klarna-payment-button");
6667Klarna.Payment.on("complete", async (paymentRequest) => {
FileDumpThingupload.ts2 matches
3import { readStdinToBuffer } from "./utils.ts";
45const API_URL = `https://filedumpthing.val.run/api/upload`;
67async function main() {
50}
5152const response = await fetch(API_URL, {
53method: "POST",
54body: formData,