Template of a custom feed generator service for the Bluesky network in Ruby
1Dir[File.join(__dir__, 'feeds', '*.rb')].each { |f| require(f) }
2
3require 'blue_factory'
4require 'sinatra/activerecord'
5
6ActiveRecord::Base.connection.execute "PRAGMA journal_mode = WAL"
7
8BlueFactory.set :publisher_did, 'did:plc:<your_identifier_here>'
9BlueFactory.set :hostname, 'feeds.example.com'
10
11BlueFactory.add_feed 'linux', LinuxFeed.new
12BlueFactory.add_feed 'starwars', StarWarsFeed.new
13
14# do any additional config & customization on BlueFactory::Server here:
15#
16# BlueFactory::Server.disable :logging
17# BlueFactory::Server.set :port, 4000
18#
19# BlueFactory::Server.get '/' do
20# redirect 'https://web.example.com'
21# end
22#
23# BlueFactory::Server.before do
24# headers "X-Powered-By" => "BlueFactory/#{BlueFactory::VERSION}"
25# end