cronJobToCheckCISAKEVmain.tsx2 matches
5const BLOB_KEY = "seen_cves";
67async function checkNewVulnerabilities() {
8const response = await fetch(KEV_URL);
9const data = await response.json();
30}
3132export default async function kevCron() {
33return await checkNewVulnerabilities();
34}
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [SplineComponent, setSplineComponent] = useState(null);
7const [error, setError] = useState(null);
50}
5152function client() {
53createRoot(document.getElementById("root")).render(<App />);
54}
56if (typeof document !== "undefined") { client(); }
5758async function server(request: Request): Promise<Response> {
59return new Response(
60`
1export default async function server(request: Request): Promise<Response> {
2try {
3const response = await fetch("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json");
cisaKEVToRSSmain.tsx4 matches
3const RSS_FEED_URL = "https://hrbrmstr-cisakevtorss.web.val.run"; // Update this to your actual RSS feed URL
45function escapeXML(str: string): string {
6return str.replace(/&/g, "&")
7.replace(/</g, "<")
11}
1213function removeInvalidXMLChars(str: string): string {
14return str
15.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "") // Control characters
19}
2021function generateRSS(data: any): string {
22const { title, catalogVersion, dateReleased, vulnerabilities } = data;
2368}
6970export async function handler(req: Request): Promise<Response> {
71try {
72const response = await fetch(CISA_JSON_URL);
eagerIndigoPigmain.tsx10 matches
15}
1617export default async function(interval: Interval): Promise<void> {
18try {
19await createTable();
3839// Create an SQLite table
40async function createTable(): Promise<void> {
41await sqlite.execute(`
42CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
5051// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53return hackerNewsSearch({
54query: topic,
58}
5960async function fetchTwitterResults(topic: string): Promise<Website[]> {
61return twitterSearch({
62query: topic,
67}
6869async function fetchRedditResults(topic: string): Promise<Website[]> {
70return redditSearch({ query: topic });
71}
7273function formatSlackMessage(website: Website): string {
74const displayTitle = website.title || website.url;
75return `*<${website.url}|${displayTitle}>*
78}
7980async function sendSlackMessage(message: string): Promise<Response> {
81const slackWebhookUrl = Deno.env.get("SLACK_WEBHOOK_URL");
82if (!slackWebhookUrl) {
104}
105106async function isURLInTable(url: string): Promise<boolean> {
107const result = await sqlite.execute({
108sql: `SELECT 1 FROM ${TABLE_NAME} WHERE url = :url LIMIT 1`,
112}
113114async function addWebsiteToTable(website: Website): Promise<void> {
115await sqlite.execute({
116sql: `INSERT INTO ${TABLE_NAME} (source, url, title, date_published)
120}
121122async function processResults(results: Website[]): Promise<void> {
123for (const website of results) {
124if (!(await isURLInTable(website.url))) {
slackScoutmain.tsx10 matches
15}
1617export default async function(interval: Interval): Promise<void> {
18try {
19await createTable();
3839// Create an SQLite table
40async function createTable(): Promise<void> {
41await sqlite.execute(`
42CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
5051// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53return hackerNewsSearch({
54query: topic,
58}
5960async function fetchTwitterResults(topic: string): Promise<Website[]> {
61return twitterSearch({
62query: topic,
67}
6869async function fetchRedditResults(topic: string): Promise<Website[]> {
70return redditSearch({ query: topic });
71}
7273function formatSlackMessage(website: Website): string {
74const displayTitle = website.title || website.url;
75return `*<${website.url}|${displayTitle}>*
78}
7980async function sendSlackMessage(message: string): Promise<Response> {
81const slackWebhookUrl = Deno.env.get("SLACK_WEBHOOK_URL");
82if (!slackWebhookUrl) {
104}
105106async function isURLInTable(url: string): Promise<boolean> {
107const result = await sqlite.execute({
108sql: `SELECT 1 FROM ${TABLE_NAME} WHERE url = :url LIMIT 1`,
112}
113114async function addWebsiteToTable(website: Website): Promise<void> {
115await sqlite.execute({
116sql: `INSERT INTO ${TABLE_NAME} (source, url, title, date_published)
120}
121122async function processResults(results: Website[]): Promise<void> {
123for (const website of results) {
124if (!(await isURLInTable(website.url))) {
ForexDataHubmain.tsx3 matches
1import { addMonths, format, subMonths } from "https://esm.sh/date-fns";
23function generateFutureEvents(months = 6) {
4const events = [];
5const startDate = new Date();
41}
4243async function server(request: Request): Promise<Response> {
44const url = new URL(request.url);
45177}
178179function getStyles() {
180return `
181<style>
linkInBioTemplatemain.tsx1 match
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
5return new Response(
6renderToString(
numbergamemain.tsx4 matches
9const HUE_DIFF = 25
1011function getColor(value: number): string {
12const power = Math.log2(value / 2)
13const hue = (power * HUE_DIFF) % 360
15}
1617function App() {
18const [board, setBoard] = useState<number[][]>([])
19const [selectedCells, setSelectedCells] = useState<[number, number][]>([])
227}
228229function client() {
230createRoot(document.getElementById("root")).render(<App />)
231}
233if (typeof document !== "undefined") { client() }
234235async function server(request: Request): Promise<Response> {
236return new Response(
237`
FanficSearcherWebsitemain.tsx5 matches
2import { configure, hits, pagination, searchBox } from "https://esm.sh/instantsearch.js@4.49.1/es/widgets";
3// first stable version is 9 and the link is https://www.val.town/v/willthereader/FanficSearcherWebsite?v=9
4function validateConfig(): { appId: string; apiKey: string } {
5const appId = Deno.env.get("ALGOLIA_APP_ID_fanficSearcher");
6const apiKey = Deno.env.get("ALGOLIA_SEARCH_API_KEY_fanficSearcher");
13}
1415function generateHtml(appId: string, apiKey: string): string {
16console.log("Generating HTML with App ID:", appId, "and API Key:", apiKey ? "exists" : "missing");
17return `
91container: '#hits',
92templates: {
93item: function(hit) {
94console.log('Hit:', hit); // Add this line
95return '<div class="hit">' +
115}
116117function handleError(error: Error): Response {
118console.error("Server error:", error);
119return new Response(`Error: ${error.message}`, { status: 500 });
120}
121122async function handleRequest(request: Request): Promise<Response> {
123console.log("Received request:", request.url);
124try {