sendNotificationREADME.md1 match
1# Push Notification Sender
23Val that can be referenced in other vals to send notifications to a specific segment using [OneSignal's REST API](https://documentation.onesignal.com/reference/create-notification)
45This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to [Netlify](https://www.netlify.com/) for free. OneSignal has [easy to follow docs](https://documentation.onesignal.com/docs/web-sdk-setup) so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then [install the PWA](https://www.bitcot.com/how-to-install-a-pwa-to-your-device/) on your platform of choice and you're off to the races!
blueskyAlertTemplatemain.tsx2 matches
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2import { AtpAgent } from "npm:@atproto/api@0.13.15";
3import pMap from "npm:p-map";
467const agent = new AtpAgent({
8service: "https://public.api.bsky.app/",
9// fetch, ideally we'd use our @std/fetch proxy here but that doesn't work and I don't know why
10});
blueskyAlertmain.tsx3 matches
1import { AtpAgent } from "npm:@atproto/api@0.13.15";
2import pMap from "npm:p-map";
356const agent = new AtpAgent({
7service: "https://public.api.bsky.app/",
8});
937if (!response.ok) {
38throw new Error(
39`Slack API error: ${response.status} ${response.statusText}`,
40);
41}
Discord-to-LinearREADME.md3 matches
33(right-click channel โ Copy ID)
34- Example: `1327384540187983926,1327384540187983927`
35- `LINEAR_API_KEY`: Your Linear API key
36- For Linear Teams accounts, you need API key permissions from a workspace
37admin.
38- Members can create personal API keys from Settings โ Account โ Security &
39Access.
40- `LINEAR_TEAM_ID`: Your Linear team UUID, this is NOT the 3 letter
linearStandup2main.tsx9 matches
5758export async function exec(interval: Interval) {
59const apiKey = Deno.env.get("LINEAR_API_KEY");
60if (!apiKey) {
61console.error("LINEAR_API_KEY not found in environment variables");
62Deno.exit(1);
63}
65const { startDate, endDate } = getYesterdayDateRange();
6667const response = await fetch("https://api.linear.app/graphql", {
68method: "POST",
69headers: {
70"Content-Type": "application/json",
71Authorization: apiKey,
72},
73body: JSON.stringify({
8081if (data.errors) {
82console.error("Error fetching data from Linear API:", data.errors);
83Deno.exit(1);
84}
94}
9596const historyResponse = await fetch("https://api.linear.app/graphql", {
97method: "POST",
98headers: {
99"Content-Type": "application/json",
100Authorization: apiKey,
101},
102body: JSON.stringify({
190}
191192const slackResponse = await fetch("https://slack.com/api/chat.postMessage", {
193method: "POST",
194headers: {
Discord-to-Linearmain.tsx3 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { CONFIG } from "./backend/config.tsx";
3import { DiscordAPI } from "./backend/discord.tsx";
4import { LinearSDK } from "./backend/linear.tsx";
52425// Initialize services
26const discord = new DiscordAPI();
27const linear = new LinearSDK();
2845*/
46async function processChannelReactions(
47discord: DiscordAPI,
48linear: LinearSDK,
49serverId: string,
subcurrentShuffle2index.ts2 matches
58}
5960// API endpoint to get a random post
61app.get("/api/random-post", async (c) => {
62try {
63// First, let's try to find the RSS feed URL
subcurrentShuffle2README.md1 match
5## Structure
67- `backend/` - Hono API server
8- `index.ts` - Main entry point with RSS fetching and serving
9- `frontend/` - React UI
asurareleasesbotsender.ts11 matches
260}
261262/*โโโโโโโโโโโโโโโโโโโโ 8 โธ Scraping Logic โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ*/
263function buildChapterObject(
264$: cheerio.CheerioAPI,
265chapterLinkElement: cheerio.Element,
266seriesTitle: string,
301302async function scrapeMainPageForChapterEvents(): Promise<ChapterEventInfo[]> {
303log("Scraping main page for chapter events:", BASE_URL);
304const chapterEvents: ChapterEventInfo[] = [];
305try {
439seriesPageUrl: string,
440): Promise<Pick<ChapterEventInfo, "definitiveSeriesTitle" | "definitiveSeriesImage" | "synopsis">> {
441log("Scraping series page for details:", seriesPageUrl);
442try {
443const { data } = await httpClient.get(seriesPageUrl, { responseType: "text" });
547log(`=== Multi-Event Announcer (Ch1, Season Start/End) to ${PRIMARY_CHAT_ID} then ${SECONDARY_CHAT_ID} ===`);
548try {
549await bot.api.getMe();
550log("Bot token validated.");
551}
650log(`Announcing to PRIMARY (${PRIMARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
651if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
652await bot.api.sendPhoto(PRIMARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
653} else {
654await bot.api.sendMessage(PRIMARY_CHAT_ID, messageContent, {
655parse_mode: "HTML",
656disable_web_page_preview: false,
664if (BOT_OWNER_ID) {
665try {
666await bot.api.sendMessage(
667BOT_OWNER_ID,
668`PRIMARY SEND FAIL: ${event.eventType} for ${nameOfManhwa}.\nError: ${e.message.substring(0, 300)}`,
679log(`Reposting to SECONDARY (${SECONDARY_CHAT_ID}): ${nameOfManhwa} - Event: ${event.eventType}`);
680if (imageUrl && (event.eventType === EventType.NEW_SERIES || event.eventType === EventType.SEASON_START)) {
681await bot.api.sendPhoto(SECONDARY_CHAT_ID, imageUrl, { caption: messageContent, parse_mode: "HTML" });
682} else {
683await bot.api.sendMessage(SECONDARY_CHAT_ID, messageContent, {
684parse_mode: "HTML",
685disable_web_page_preview: false,
691if (BOT_OWNER_ID) {
692try {
693await bot.api.sendMessage(
694BOT_OWNER_ID,
695`SECONDARY REPOST FAIL: ${event.eventType} for ${nameOfManhwa} (Primary was OK).\nError: ${
Discord-to-Lineardiscord.tsx5 matches
1import { CONFIG } from "./config.tsx";
23export class DiscordAPI {
4// Fetch from the Discord API
5private async discordFetch(endpoint: string): Promise<any> {
6console.log(Deno.env.get("DISCORD_BOT_TOKEN"));
7console.log(`https://discord.com/api/v10${endpoint}`);
8const response = await fetch(`https://discord.com/api/v10${endpoint}`, {
9headers: { "Authorization": `Bot ${Deno.env.get("DISCORD_BOT_TOKEN")}` },
10});
11console.log(response.status);
12if (!response.ok) {
13throw new Error(`Discord API error: ${response.status}`);
14}
15