Closed hate5six closed 6 years ago
I have same problem and got a work around solution, hope it'll help until they fix this:
from urlparse import urlparse, parse_qs
cursor = parse_qs(urlparse(pledges_response.json_data['links']['next']).query)['page[cursor]'][0]
@hunganh0403 interesting. What is the pledges_response object in your example? I'm using the code from the demo so it's a JSONAPIParser object. It doesn't have a get method so pledges_response['links']['next'] fails.
EDIT: looks like the following does the trick for me:
parse_qs(urlparse(pledges_response.__dict__['json_data']['links']['next']).query)['page[cursor]'][0]
pledges_response.json_data will do. I've edited in my comment. pledges_response in old version is json itself, I've copied my code without update to new Patreon API new version.
Hey there! Thanks for writing in, we're going to look into this.
Same issue, any updates?
The code here also has a typo (and doesn't work) https://docs.patreon.com/?python#fetch-a-creator-profile-and-campaign-info
The all_pledges
should be pledges
or the other way around.
all_pledges = []
cursor = None
while True:
pledges_response = api_client.fetch_page_of_pledges(campaign_id, 25, cursor=cursor)
pledges += pledges_response.data()
cursor = api_client.extract_cursor(pledges_response)
if not cursor:
break
Hey there. I'm really sorry we've been so delayed on getting this fixed; I'm hoping we'll have an answer for you all this week!
Hi everyone, I am closing this issue as this problem should now be fixed in the latest version.
I'm attempting to replicate the example here for retrieving all pledges to a campaign: https://docs.patreon.com/?python#fetch-a-creator-profile-and-campaign-info
However, I get the following error (I'm using a valud access_token):