Skip to content

Commit

Permalink
Tidied up .env.example & Added detail to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bossett committed Jul 7, 2023
1 parent d5a316c commit f2e27ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ FEEDGEN_LISTS="at://did:plc: ... /app.bsky.graph.list/ ... |at:// etc..."
# The text to watch for for list inclusion. Use "" for everything
FEEDGEN_SYMBOL="..."

# Mostly for dev - clears the db on startup, and manipulates the refresh timer
# The refresh timer. Algorithms have periodicTask() called this often.

FEEDGEN_TASK_INTEVAL_MINS=15
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
# Bossett's little feed collection

Playing around with Bluesky's custom feeds. Very basic - just a small iteration on the template for the moment, to grab a user list, and then look for specific terms in posts from those users.
This code was originally a fork of https://github.com/bluesky-social/feed-generator - and you can look there for more information about the mechanics of feed generation. In particular - for questions about 'how to publish the feed' from the script in the scripts folder.

## Science Feed

Watches for 🧪 posted by people on a set of watchlists (e.g. https://bsky.app/profile/did:plc:jfhpnnst6flqway4eaeqzj2a/lists/3jx3w32axax2f)

Feed at https://bsky.app/profile/did:plc:jfhpnnst6flqway4eaeqzj2a/feed/for-science

## Usage

I run this with Digital Ocean App Platform, with their MongoDB as an attached service.

### Database

You probably don't need Mongo if you're just doing something simple - and I've put all the DB work in [src/db/dbClient.ts](src/db/dbClient.ts) to make that easy to change.

### Docker

I am deploying with Docker rather than the default Node containers. This was more important early on for control over the exact Node version, as certain dependencies were linked tightly to Node 18.

## Adding Feeds

The tool is built to have each algorithm self-contained within a file in [src/algos](src/algos). Each algorithm should export both a handler function and manager class (that can inherit from algoManager - see the for-science feed). The _manager_ is expected to implement a filter method that will match posts that the algorithm will later deal with.

Where there's a match, the post will be stored in the database, tagged for the algorithm that matched. This can be used later in the handler function to identify posts that the algorithm should return.

Feeds will have periodicTask called every X minutes from the environment setting in FEEDGEN_TASK_INTEVAL_MINS - this is for things like list updates, or time consuming tasks that shouldn't happen interactively.

## Major TODOs

TODO: Cache header in feed-generation.ts
TODO: List for exclusion, header catching
TODO: Pin function
- TODO: Rename environment variables, etc. to make settings more generic
- TODO: Cache header in feed-generation.ts
- TODO: List for exclusion, header catching
- TODO: Pin function

0 comments on commit f2e27ec

Please sign in to comment.