Code Monkey home page Code Monkey logo

Comments (8)

hunganh0403 avatar hunganh0403 commented on September 18, 2024

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]

from patreon-python.

hate5six avatar hate5six commented on September 18, 2024

@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]

from patreon-python.

hunganh0403 avatar hunganh0403 commented on September 18, 2024

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.

from patreon-python.

phildini avatar phildini commented on September 18, 2024

Hey there! Thanks for writing in, we're going to look into this.

from patreon-python.

mubix avatar mubix commented on September 18, 2024

Same issue, any updates?

from patreon-python.

mubix avatar mubix commented on September 18, 2024

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

from patreon-python.

phildini avatar phildini commented on September 18, 2024

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!

from patreon-python.

lynneatan avatar lynneatan commented on September 18, 2024

Hi everyone, I am closing this issue as this problem should now be fixed in the latest version.

from patreon-python.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.