Avatar

nicopreme

Joined August 30, 2024
Likes
5
muhammad_owais_warsi avatar
todoListUsingBlob
@muhammad_owais_warsi
HTTP
A simple TODO list using Blob Storage
pomdtr avatar
webdavServer
@pomdtr
Script
Webdav Manage your vals from a webdav client (ex: https://cyberduck.io/) ⚠️ some webdav operations are not supported, so support can vary between clients. Installation Click "Create Val" on the code block, and change it's type to http. import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken"; import { serveVals } from "https://esm.town/v/pomdtr/webdavServer"; export default basicAuth(serveVals, { verifyUser: (user) => { return verifyToken(user); }, }); Use a val town token as the username, and keep the password blank to authenticate.
stevekrouse avatar
sqlite
@stevekrouse
Script
Forked from std/sqlite
pomdtr avatar
password_auth
@pomdtr
Script
Password Auth Middleware Protect your vals behind a password. Use session cookies to persist authentication. Demo See @pomdtr/password_auth_test Usage import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84"; export default passwordAuth(() => { return new Response("OK"); }, { verifyPassword: (password) => password == Deno.env.get("VAL_PASSWORD") }); If you want to use an api token to authenticate: import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84"; import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken"; export default passwordAuth(() => { return new Response("OK"); }, { verifyPassword: verifyToken }); TODO [x] allow to authenticate using a val town token [ ] add a way to send an email to ask a password from the val owner [ ] automatically extend the session [ ] automatically remove expired sessions FAQ How to sign out ? Navigate to <your-site>/signout .
ktodaz avatar
sendDiscordMessage
@ktodaz
Script
Send Chunked Discord Message This function is used to send a message to a Discord webhook. If the message exceeds the maximum character limit (2000 characters), it will be divided into chunks and sent as multiple messages. Parameters message (string): The message to be sent to the Discord webhook. Return Value This function does not return any value. Example Usage: const message = "This is a long message that needs to be sent to Discord. It may exceed the character limit, so it will be divided into smaller chunks."; await @ktodaz.sendDiscordMessage(message); In the above example, the sendDiscordMessage function is used to send the message to the Discord webhook. If the message exceeds 2000 characters, it will be split into smaller chunks and sent as separate messages. Required Secrets: Ensure you have added the secret for discord_webhook in your val.town secrets settings (Profile -> Secrets)
Next