+9
-3
app/firehose_stream.rb
+9
-3
app/firehose_stream.rb
···
10
10
class FirehoseStream
11
11
attr_accessor :show_progress, :log_status, :log_posts, :save_posts, :replay_events
12
12
13
-
DEFAULT_RELAY = 'bsky.network'
13
+
DEFAULT_JETSTREAM = 'jetstream2.us-east.bsky.network'
14
14
15
15
def initialize(service = nil)
16
16
@env = (ENV['APP_ENV'] || ENV['RACK_ENV'] || :development).to_sym
17
-
@service = service || DEFAULT_RELAY
17
+
@service = service || DEFAULT_JETSTREAM
18
18
19
19
@show_progress = (@env == :development) ? true : false
20
20
@log_status = true
···
31
31
last_cursor = load_or_init_cursor
32
32
cursor = @replay_events ? last_cursor : nil
33
33
34
-
@sky = sky = Skyfall::Firehose.new(@service, :subscribe_repos, cursor)
34
+
@sky = sky = Skyfall::Jetstream.new(@service, {
35
+
cursor: cursor,
36
+
37
+
# we ask Jetstream to only send us post records, since we don't need anything else
38
+
# if you need to process e.g. likes or follows too, update or remove this param
39
+
wanted_collections: ['app.bsky.feed.post'],
40
+
})
35
41
36
42
# set your user agent here to identify yourself on the relay
37
43
# @sky.user_agent = "My Feed Server (@my.handle) #{@sky.version_string}"