Toot toooooooot (Bluesky-Mastodon cross-poster)

update to latest minisky

+1 -1
Gemfile
··· 2 3 gem 'didkit', '~> 0.2' 4 gem 'mastodon-api', git: 'https://github.com/mastodon/mastodon-api.git' 5 - gem 'minisky', '~> 0.3' 6 7 gem 'io-console', '~> 0.5' 8 gem 'json', '~> 2.5'
··· 2 3 gem 'didkit', '~> 0.2' 4 gem 'mastodon-api', git: 'https://github.com/mastodon/mastodon-api.git' 5 + gem 'minisky', '~> 0.4' 6 7 gem 'io-console', '~> 0.5' 8 gem 'json', '~> 2.5'
+4 -2
Gemfile.lock
··· 13 specs: 14 addressable (2.8.6) 15 public_suffix (>= 2.0.2, < 6.0) 16 bigdecimal (3.1.7) 17 buftok (0.3.0) 18 didkit (0.2.0) ··· 33 ffi-compiler (>= 1.0, < 2.0) 34 io-console (0.7.2) 35 json (2.7.1) 36 - minisky (0.3.1) 37 net-http (0.4.1) 38 uri 39 oj (3.16.3) ··· 52 io-console (~> 0.5) 53 json (~> 2.5) 54 mastodon-api! 55 - minisky (~> 0.3) 56 net-http (~> 0.2) 57 uri (~> 0.13) 58 yaml (~> 0.1)
··· 13 specs: 14 addressable (2.8.6) 15 public_suffix (>= 2.0.2, < 6.0) 16 + base64 (0.2.0) 17 bigdecimal (3.1.7) 18 buftok (0.3.0) 19 didkit (0.2.0) ··· 34 ffi-compiler (>= 1.0, < 2.0) 35 io-console (0.7.2) 36 json (2.7.1) 37 + minisky (0.4.0) 38 + base64 (~> 0.1) 39 net-http (0.4.1) 40 uri 41 oj (3.16.3) ··· 54 io-console (~> 0.5) 55 json (~> 2.5) 56 mastodon-api! 57 + minisky (~> 0.4) 58 net-http (~> 0.2) 59 uri (~> 0.13) 60 yaml (~> 0.1)
+2 -8
app/bluesky_account.rb
··· 41 end 42 43 def fetch_blob(cid) 44 - # todo 45 - @sky.get_blob('com.atproto.sync.getBlob', { did: @sky.user.did, cid: cid }) 46 end 47 48 def delete_record_at(uri) 49 repo, collection, rkey = uri.split('/')[2..4] 50 - 51 - begin 52 - @sky.post_request('com.atproto.repo.deleteRecord', { repo: repo, collection: collection, rkey: rkey }) 53 - rescue JSON::ParserError 54 - # todo 55 - end 56 end 57 end
··· 41 end 42 43 def fetch_blob(cid) 44 + @sky.get_request('com.atproto.sync.getBlob', { did: @sky.user.did, cid: cid }) 45 end 46 47 def delete_record_at(uri) 48 repo, collection, rkey = uri.split('/')[2..4] 49 + @sky.post_request('com.atproto.repo.deleteRecord', { repo: repo, collection: collection, rkey: rkey }) 50 end 51 end
-21
app/bluesky_client.rb
··· 24 def save_config 25 File.write(CONFIG_FILE, YAML.dump(@config)) 26 end 27 - 28 - def get_blob(method, params = nil) 29 - check_access 30 - 31 - headers = authentication_header(true) 32 - url = URI("#{base_url}/#{method}") 33 - 34 - if params && !params.empty? 35 - url.query = URI.encode_www_form(params) 36 - end 37 - 38 - request = Net::HTTP::Get.new(url, headers) 39 - response = make_request(request) 40 - 41 - case response 42 - when Net::HTTPSuccess 43 - response.body 44 - else 45 - handle_response(response) 46 - end 47 - end 48 end
··· 24 def save_config 25 File.write(CONFIG_FILE, YAML.dump(@config)) 26 end 27 end