A simple Ruby server using Sinatra that serves Bluesky custom feeds
1require_relative 'blue_factory/configuration'
2require_relative 'blue_factory/server'
3require_relative 'blue_factory/version'
4
5#
6# This is the main module of the library, through which you configure the feed service.
7#
8# @example Configuring the server and feeds
9# require 'blue_factory'
10#
11# BlueFactory.set :publisher_did, 'did:plc:qwertyuiopasdf'
12# BlueFactory.set :hostname, 'feeds.example.com'
13#
14# BlueFactory.add_feed 'photos', PhotographyFeed.new
15#
16# @example Handling interactions
17# BlueFactory.on_interactions do |interactions, context|
18# interactions.each do |i|
19# unless i.type == :seen
20# puts "[#{Time.now}] #{context.user.raw_did}: #{i.type} #{i.item}"
21# end
22# end
23# end
24#
25
26module BlueFactory
27
28 # The collection NSID of a Bluesky feed generator service.
29 FEED_GENERATOR_TYPE = 'app.bsky.feed.generator'
30
31 # Maximum allowed value for the limit parameter in `getFeedSkeleton`.
32 MAX_LIMIT = 100
33
34 # Default value for the limit parameter in `getFeedSkeleton`. This value isn't used by the library
35 # (if no limit parameter is passed, it isn't added), but you can use it as a fallback in your code.
36 DEFAULT_LIMIT = 50
37end