aiTextEditormain.tsx3 matches
1/**
2* This val creates a text editing tool using the Cerebras Llama 70B model.
3* It includes a command input field with speech-to-text functionality, a collapsible additional context area,
4* and a rich text editor. The user's command, additional context, and current text are sent to the Cerebras API,
5* which returns the modified text to be displayed in the editor.
89// Server-side code
10async function server(request: Request): Promise<Response> {
11if (request.method === "POST" && new URL(request.url).pathname === "/process") {
12const { command, text, additionalContext } = await request.json();
70import ReactQuill from "https://esm.sh/react-quill";
7172function App() {
73const [command, setCommand] = useState("");
74const [editorContent, setEditorContent] = useState("<p></p>");
1This module provides functions to convert HTML to various formats such as Markdown, Pug, and Turndown.
2It also includes utilities to fetch HTML from a URL, extract metadata, and clean HTML by removing unwanted selectors.
3Dependencies include Cheerio for HTML parsing, JSDOM for DOM manipulation, and Turndown for converting HTML to Markdown.
agenta_webhook_evalmain.tsx1 match
12export default async function server(request: Request): Promise<Response> {
34// Parse the request body
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))) {
4import RssParser from "npm:rss-parser";
56export async function rssNotify() {
7const lastRunAt = await blob.getJSON(getLegacyImportUrl(import.meta.url));
8console.log(`Last run: ${lastRunAt || "Never"}`);
smsjournalertextrelaymain.tsx10 matches
34// this is either broken or textbelt is not sending me the right stuff
35// this is implemented per the textbelt docs but i cant verify the sig...
36function validateTextbeltRequestSignature(
37apiKey: string,
38timestamp: string,
52}
5354// Helper function to send SMS using TextBelt API
55async function sendSMS(phone: string, message: string) {
56const response = await fetch("https://textbelt.com/text", {
57method: "POST",
68}
6970// Helper function to get conversation history
71async function getConversationHistory(phone: string): Promise<Message[]> {
72const key = makeBlobKey(phone);
73const history = await blob.getJSON(key) as Message[] | null;
75}
7677// Helper function to update conversation history
78async function updateConversationHistory(phone: string, message: Message) {
79const key = makeBlobKey(phone);
80const history = await getConversationHistory(phone);
83}
8485// Helper function to generate AI response
86async function generateAIResponse(history: Message[]): Promise<string> {
87const openai = new OpenAI();
88const messages: { role: "user" | "assistant" | "system"; content: string }[] = history.map(msg => ({
106}
107108export default async function server(request: Request): Promise<Response> {
109const quotaResponse = await fetch(
110`https://textbelt.com/quota/${textbeltKey}`,
1export function svgEmoji(req: Request) {
2const url = new URL(req.url);
3const emoji = decodeURIComponent(url.pathname.slice(1));
linkInBioTemplatemain.tsx6 matches
5// ... (previous AuthContext, AuthProvider, and useAuth remain the same)
67function App() {
8// ... (App component remains the same)
9}
1011function Home({ theme }) {
12const { user } = useAuth();
13const isDark = theme === 'dark';
51}
5253function PromptGenerator() {
54const [prompt, setPrompt] = useState('');
5580}
8182function Tools({ theme }) {
83const isDark = theme === 'dark';
84const tools = [
102}
103104function Gallery({ theme }) {
105const isDark = theme === 'dark';
106const [filter, setFilter] = useState('all');
209};
210211// ... (client and server functions remain the same)
finalScrapermain.tsx3 matches
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
10const [link, setLink] = useState("");
11const [results, setResults] = useState(null);
81}
8283function client() {
84createRoot(document.getElementById("root")).render(<App />);
85}
89}
9091async function server(request: Request): Promise<Response> {
92if (request.method === "POST" && new URL(request.url).pathname === "/scrape") {
93const { link } = await request.json();
hasWebsiteChangedmain.tsx1 match
7import slugify from "npm:slugify";
89export async function hasWebsiteChanged(url: string, threshold = 0.5) {
10const slug = slugify(url);
11