A Ruby gem for streaming data from the Bluesky/ATProto firehose

added example script

+30 -1
+2
README.md
··· 83 83 end 84 84 ``` 85 85 86 + See complete example in [example/firehose.rb](https://github.com/mackuba/skyfall/blob/master/example/firehose.rb). 87 + 86 88 87 89 ## Credits 88 90
+27
example/firehose.rb
··· 1 + #!/usr/bin/env ruby 2 + 3 + lib = File.expand_path('../../lib', __FILE__) 4 + $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 5 + 6 + require 'skyfall' 7 + 8 + sky = Skyfall::Stream.new('bsky.social', :subscribe_repos) 9 + 10 + sky.on_message do |m| 11 + next if m.type != :commit 12 + 13 + m.operations.each do |op| 14 + next unless op.action == :create && op.type == :bsky_post 15 + 16 + puts "#{op.repo}:" 17 + puts op.raw_record['text'] 18 + puts 19 + end 20 + end 21 + 22 + sky.on_connect { puts "Connected" } 23 + sky.on_disconnect { puts "Disconnected" } 24 + sky.on_error { |e| puts "ERROR: #{e}" } 25 + 26 + sky.connect 27 + sleep
+1 -1
skyfall.gemspec
··· 28 28 } 29 29 30 30 spec.files = Dir.chdir(__dir__) do 31 - Dir['*.md'] + Dir['*.txt'] + Dir['lib/**/*'] + Dir['sig/**/*'] 31 + Dir['*.md'] + Dir['*.txt'] + Dir['example/**/*'] + Dir['lib/**/*'] + Dir['sig/**/*'] 32 32 end 33 33 34 34 spec.require_paths = ["lib"]