diff --git a/config/configuration.rb b/config/configuration.rb index 18f77cd..d824bf7 100644 --- a/config/configuration.rb +++ b/config/configuration.rb @@ -1,13 +1,11 @@ module Pastebinner class Configuration - attr_accessor :api_key, :api_username, :api_password, :elasticsearch_url, :redis_url + attr_accessor :api_key, :api_username, :api_password def initialize @api_key = nil @api_username = nil @api_password = nil - @elasticsearch_url = nil - @redis_url = nil end end end diff --git a/lib/pastebinner/api_client.rb b/lib/pastebinner/api_client.rb index 477a155..f59c067 100644 --- a/lib/pastebinner/api_client.rb +++ b/lib/pastebinner/api_client.rb @@ -100,11 +100,17 @@ module Pastebinner end # will extract just the keys from recent public pastes + # i think this can be maybe made into a hash instead def get_unique_paste_keys(public_pastes) pp = JSON.parse(public_pastes) pp.map { |p| p['key'] } end + def unique_paste_keys(public_pastes) + pp = JSON.parse(public_pastes) + pp.map { |paste| :url => paste['url'], :key => paste['key'] } + end + def raw_paste_data(unique_paste_key) response = RestClient::Request.execute( method: :get,