4
5This val gets Twitter data via [SocialData](https://socialdata.tools) via
6@stevekrouse/socialDataProxy. Val Town Pro users can call this API
7100 times per day, so be sure not to set this cron to run more than once every 15 min.
8If you want to use it more, get your own [SocialData](https://socialdata.tools)
9API token and pay for it directly.
10
11## 1. Query
13Change the `query` variable for what you want to get notified for.
14
15You can use [Twitter's search operators](https://developer.twitter.com/en/docs/twitter-api/v1/rules-and-filtering/search-operators) to customize your query, for some collection of keywords, filtering out others, and much more!
16
17## 2. Notification
25
26### Consciousness and the Cosmos
27Contemplate the nature of **consciousness** and its role in shaping reality. Explore theories of the universe as a **holographic projection** of consciousness itself and how this could provide a framework for magical manifestation and psychic abilities.
28
29
74 {
75 text: "Express.js",
76 description: "Domina Express.js para crear aplicaciones web y APIs de manera rápida y eficiente.",
77 completed: false
78 },
119 {
120 id: 5,
121 title: "APIs y Autenticación",
122 description: "Desarrolla APIs RESTful seguras, implementa autenticación y autorización usando las mejores prácticas de Node.js.",
123 completed: false,
124 subtopics: [
125 {
126 text: "Diseño de APIs RESTful",
127 description: "Aprende principios de diseño de APIs RESTful, buenas prácticas y patrones de arquitectura.",
128 completed: false
129 },
139 },
140 {
141 text: "Seguridad en APIs",
142 description: "Aprende técnicas de seguridad como validación de entrada, prevención de inyección, y manejo de CORS.",
143 completed: false
37 e.preventDefault();
38 try {
39 const response = await fetch("/api/vehicle", {
40 method: "POST",
41 headers: {
124
125 const fetchAllVehicles = async () => {
126 const response = await fetch("/api/all-vehicles");
127 const data = await response.json();
128 setVehicles(data);
235
236 const fetchVehicles = async (company) => {
237 const response = await fetch(`/api/vehicles?company=${company}`);
238 const data = await response.json();
239 setVehicles(data);
241
242 const fetchAllVehicles = async () => {
243 const response = await fetch("/api/all-vehicles");
244 const data = await response.json();
245 return data;
480 const path = url.pathname;
481
482 if (request.method === "POST" && path === "/api/vehicle") {
483 const body = await request.json();
484 await sqlite.execute(
506 }
507
508 if (path === "/api/vehicles") {
509 const company = url.searchParams.get("company");
510 const vehicles = await sqlite.execute(`SELECT * FROM ${KEY}_vehicles_${SCHEMA_VERSION} WHERE company = ?`, [
516 }
517
518 if (path === "/api/all-vehicles") {
519 const vehicles = await sqlite.execute(`SELECT * FROM ${KEY}_vehicles_${SCHEMA_VERSION}`);
520 return new Response(JSON.stringify(vehicles.rows), {
523 }
524
525 if (path.startsWith("/api/vehicle/")) {
526 const plateNumber = path.split("/").pop();
527 const vehicle = await sqlite.execute(`SELECT * FROM ${KEY}_vehicles_${SCHEMA_VERSION} WHERE plateNumber = ?`, [
47 ],
48 projects: [
49 { text: "API REST básica", completed: false },
50 { text: "Servidor de archivos", completed: false },
51 { text: "Sistema de autenticación simple", completed: false },
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
75```
76
77### Lower-level API
78
79We provide access to the lower-level getter and setters,
82
83* `async get(key: string)`: Retrieves a blob for a given key.
84* `async set(key: string, value: string | BodyInit)`: Sets the blob value for a given key. See [BodyInit](https://deno.land/api@v1.38.1?s=BodyInit).
85
86### Limitations
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
3import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
124
125async function set(key: string, value: BodyInit) {
126 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127 method: "POST",
128 headers: {
155 <head>
156 <title>SQLite Explorer</title>
157 <link rel="preconnect" href="https://fonts.googleapis.com" />
158 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
159 <link
160 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
161 rel="stylesheet"
162 />