notion-2-blueskyREADME.md7 matches
1# N2B Scheduler - Notion to Bluesky Auto Poster
23An automated scheduler that reads posts from a Notion database and publishes them to Bluesky at scheduled times.
45See it in action, https://bsky.app/profile/nucky.bsky.social
7## Features
89- ๐ Schedule Bluesky posts from Notion database
10- ๐ค Automatic posting via cron job (every 15 minutes)
11- ๐ Status tracking (Draft โ Scheduled โ Posted)
15## Setup
1617### 1. Notion Database Setup
1819Your database needs these fields:
20- **Title** (Title field) - Post title/identifier
21- **Text** (Rich Text field) - The post content
29Set these in your Val Town environment:
30- `NOTION_TOKEN` - Your Notion integration token
31- `NOTION_DATABASE_ID` - Your database ID
32- `BLUESKY_HANDLE` - Your Bluesky handle (e.g., user.bsky.social)
33- `BLUESKY_APP_PASSWORD` - Your Bluesky app password
38- Read content
39- Update content
40- Read database structure
4142## Files
56## Usage
57581. Create a new row in your Notion database
592. Set the Text field with your post content
603. **Optional**: Upload images to the Media field (supports JPG, PNG, GIF, WebP)
scrape-hwsreddit-scraper.ts2 matches
170171/**
172* Check if a post already exists in the database
173*/
174async postExists(redditId: string): Promise<boolean> {
193194/**
195* Save a post to the database
196*/
197async savePost(post: RedditPost): Promise<boolean> {
scrape-hwsREADME.md7 matches
1# Reddit /r/hardwareswap Scraper
23A Val Town application that scrapes posts from Reddit's /r/hardwareswap subreddit and stores them in a Supabase database.
45## Features
67- ๐ Automated scraping of /r/hardwareswap posts using Reddit's official OAuth API
8- ๐๏ธ Stores posts in Supabase PostgreSQL database
9- ๐ซ Duplicate detection to avoid storing the same post twice
10- ๐ Detailed logging and statistics
311. Create a new project in [Supabase](https://supabase.com)
322. Go to the SQL Editor in your Supabase dashboard
333. Copy and paste the contents of `database-schema.sql` and run it
344. Go to Settings > API to get your project URL and anon key
3556- Every 15 minutes: `*/15 * * * *`
5758## Database Schema
5960The `posts` table contains:
65- `title`: Post title
66- `created_at`: When the post was created on Reddit
67- `updated_at`: When the record was last updated in our database
6869## Usage
791. Authenticate with Reddit using OAuth client credentials
802. Fetch the latest 25 posts from /r/hardwareswap
813. Check for duplicates in the database
824. Save new posts to Supabase
835. Log statistics about the scraping session
1151161. **Missing environment variables**: Ensure all required Reddit and Supabase credentials are set
1172. **Database connection errors**: Verify your Supabase credentials and that the table exists
1183. **Reddit OAuth errors**: Check your Reddit app credentials and ensure the app type is "script"
1194. **Rate limiting**: Reddit may temporarily block requests if rate limits are exceeded
scrape-hwsscraper-api.ts1 match
306<div class="endpoint">
307<div class="method">GET /stats</div>
308<div>Get scraping statistics and database info</div>
309</div>
310
1-- Supabase Database Schema for Reddit Scraper
2-- Run this SQL in your Supabase SQL editor to create the posts table
3
19try {
20const server = new McpServer({
21name: "Lyrics Database",
22version: "1.0.0",
23});
stevensDemosetupTelegramChatDb.ts2 matches
1// Script to set up the telegram_chats table in SQLite
2// Run this script manually to create the database table
34export default async function setupTelegramChatDb() {
25`);
2627return "Telegram chat database table created successfully.";
28} catch (error) {
29console.error("Error setting up telegram_chats table:", error);
stevensDemoREADME.md3 matches
13## Technical Architecture
1415**โ ๏ธ important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure. if you fork this project and put sensitive data in a database you should think carefully about how to secure it.**
1617Stevens has been designed with the utmost simplicity and extensibility, much like a well-organized household. At the heart of his operation lies a single "memories" table - a digital equivalent of a butler's meticulous records. This table serves as the foundation for all of Stevens' operations.
45- `dashboard`: the admin view for showing the memories notebook + visualizing imports
46- `dailyBriefing`: stuff related to sending a daily update via telegram
47- `dbUtils`: little one-off scripts for database stuff
4849## Hiring your own Stevens
57- For the Google Calendar integration you'll need `GOOGLE_CALENDAR_ACCOUNT_ID` and `GOOGLE_CALENDAR_CALENDAR_ID`. See [these instuctions](https://www.val.town/v/stevekrouse/pipedream) for details.
5859**important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure, if you put sensitive data in a database you should think carefully about how to secure it.**
6061Overall it's a simple enough project that I encourage you to just copy the ideas and run in your own direction rather than try to use it as-is.
stevensDemoREADME.md2 matches
45* `index.ts` - this is the **entrypoint** for this whole project
6* `database/` - this contains the code for interfacing with the app's SQLite database table
78## Hono
26## CRUD API Routes
2728This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
2930## Errors
stevensDemoREADME.md6 matches
1# Database
23This app uses [Val Town SQLite](https://docs.val.town/std/sqlite/) to manage data. Every Val Town account comes with a free SQLite database, hosted on [Turso](https://turso.tech/). This folder is broken up into two files:
45* `migrations.ts` - code to set up the database tables the app needs
6* `queries.ts` - functions to run queries against those tables, which are imported and used in the main Hono server in `/backend/index.ts`
78## Migrations
910In `backend/database/migrations.ts`, this app creates a new SQLite table `reactHonoStarter_messages` to store messages.
1112This "migration" runs once on every app startup because it's imported in `index.ts`. You can comment this line out for a slight (30ms) performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.
1314SQLite has much more limited support for altering existing tables as compared to other databases. Often it's easier to create new tables with the schema you want, and then copy the data over. Happily LLMs are quite good at those sort of database operations, but please reach out in the [Val Town Discord](https://discord.com/invite/dHv45uN5RY) if you need help.
1516## Queries
1718The queries file is where running the migrations happen in this app. It'd also be reasonable for that to happen in index.ts, or as is said above, for that line to be commented out, and only run when actual changes are made to your database schema.
1920The queries file exports functions to get and write data. It relies on shared types and data imported from the `/shared` directory.