-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package Updates? #38
Comments
I tried this package today and Step3 code did not work. api_client = patreon.API(creator_access_token)
campaign_id = api_client.get_campaigns(10).data()[0].id()
members = []
cursor = None
while True:
members_response = api_client.get_campaigns_by_id_members(
campaign_id, 100, cursor=cursor,
includes=["user"],
fields={
# See patreon/schemas/member.py
"member": ["full_name", "email", "lifetime_support_cents"]
})
members += members_response.data()
# debug print
# print(members_response.json_data)
if members_response.json_data.get("links") is None:
# Avoid Exception: ('Provided cursor path did not result in a link' ..
break
cursor = api_client.extract_cursor(members_response)
for member in members:
print(member.relationship("user").id(),
member.attribute('full_name'),
member.attribute('email'),
member.attribute('lifetime_support_cents') / 100) Is this due to a change in the server side specifications? |
Patreon seems to have abandoned the library unfortunately. For what it's worth it was not incredibly difficult to create my own library for my purposes, unfortunately I went with C# so it wouldn't be of much use to you I expect. I would suggest making a fork of this repo and making any required changes and using that instead. |
Thanks for the advice. |
It's disappointing that the official library linked from patreon has been abandoned like this. |
Thanks for the code @nagadomi , by using the master branch in my pip requirements, I managed to make it work using your code. |
I am running the above code in cron(run from scheduler, update database), but note the problem that the I am using the following pseudo code to detect errors while updating the tokens. client = patreon.OAuth(client_id, client_secret)
refresh_token, access_token = load_tokens()
new_token = client.refresh_token(refresh_token)
if "refresh_token" not in new_token:
print(new_token)
raise RuntimeError("error refresh_token is changed on server side!!!")
new_access_token = new_token["access_token"]
new_refresh_token = new_token["refresh_token"]
save_tokens(new_token) |
Will this package be properly updated? It is nearly 2023.
Also the documentation for iterating over the pledged users in the readme is incredibly out of date even with the current version of the library.
The text was updated successfully, but these errors were encountered: