Open hovancik opened 5 years ago
Temporary workaround:
In Gemfile
use my fork:
# Patreon
gem 'patreon', git: 'https://github.com/hovancik/patreon-ruby', branch: 'feature/remove-json-api-vanilla'
Then update your code to not use broken json-api-vanilla
, ie to get all your patron IDs:
api_client = Patreon::API.new(ENV.fetch('PATREON_ACCESS_TOKEN'))
campaign_response = api_client.fetch_campaign
campaign_id = campaign_response['data'][0]['id']
all_pledges = []
cursor = nil
loop do
page_response = api_client.fetch_page_of_pledges(campaign_id, count: 25, cursor: cursor)
all_pledges += page_response['data']
next_page_link = page_response['links']['next']
break unless next_page_link
parsed_query = CGI::parse(next_page_link)
cursor = parsed_query['page[cursor]'][0]
end
all_pledges.map { |pledge| pledge['relationships']['patron']['data']['id'] }
Hi,
I am trying to fetch patrons but I am getting errors:
when I call it within a background job, I see this error: