Giter Site home page Giter Site logo

bluesky-seattle-feed's Introduction

What's All This?

At some point (unless someone else beats me to it) this will be an ATProto Feed Generator for Seattle-oriented posts.

The funding link on the right is correct -- most of the work here was from the person who wrote the original code. I just hacked on it a bit.

ATProto Feed Generator powered by The AT Protocol SDK for Python

Feed Generators are services that provide custom algorithms to users through the AT Protocol.

Official overview (read it first): https://github.com/bluesky-social/feed-generator#overview

Feed example: https://bsky.app/profile/did:plc:kvwvcn5iqfooopmyzvb4qzba/feed/whats-alf

Getting Started

We've set up this simple server with SQLite to store and query data. Feel free to switch this out for whichever database you prefer.

Next, you will need to do two things:

  1. Implement indexing logic in server/data_filter.py.
  2. Implement feed generation logic in server/algos.

We've taken care of setting this server up with a did:web. However, you're free to switch this out for did:plc if you like - you may want to if you expect this Feed Generator to be long-standing and possibly migrating domains.

Publishing your feed

To publish your feed, go to the script at publish_feed.py and fill in the variables at the top. Examples are included, and some are optional. To publish your feed generator, simply run python publish_feed.py.

To update your feed's display data (name, avatar, description, etc.), just update the relevant variables and re-run the script.

After successfully running the script, you should be able to see your feed from within the app, as well as share it by embedding a link in a post (similar to a quote post).

Running the Server

Install Python 3.7+, optionally create virtual environment.

Install dependencies:

pip install -r requirements.txt

Copy .env.example as .env. Fill the variables.

Note To get value for "WHATS_ALF_URI" you should publish the feed first.

Run development flask server:

flask run

Run development server with debug:

flask --debug run

Note Duplication of data stream instances in debug mode is fine. Read warn below.

Warning In production, you should use production WSGI server instead.

Warning If you want to run server in many workers, you should run Data Stream (Firehose) separately.

Endpoints:

  • /.well-known/did.json
  • /xrpc/app.bsky.feed.describeFeedGenerator
  • /xrpc/app.bsky.feed.getFeedSkeleton

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.