Public
Cron
v23
June 11, 2024
Runs every 20 min
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
import { twitterSearch } from "https://esm.town/v/stevekrouse/twitterSearch";
const query = "\"val.town\" OR \"val town\" -_ValTown_ -is:retweet";
export async function twitterAlert({ lastRunAt }: Interval) {
const results = await twitterSearch({
query,
start_time: lastRunAt,
bearerToken: Deno.env.get("twitter"),
});
if (!results.length) return;
// format results
let content = results
.map(({ author_name, author_username, text, id }) => `https://fxtwitter.com/${author_username}/status/${id}`)
.join("\n");
// notify
await discordWebhook({
url: Deno.env.get("mentionsDiscord"),
content,
});
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
v23 was merged from the PR "Filter out retweets" by sumukh
v23
June 11, 2024
Hi! I would like to borrow your token please. I just signed up for Pro.
Sure thing! Let me make you your own private API!
Hiya! I'd also like to borrow it please if the offer still stands ^-^
Great! Will email you :)
Hi Steve! Would love to borrow your token :)
Sure thing! Will email you :)
Hey! Would love to borrow your token to test this out :)
Sure thing! Will email you :)