ErikBoesen / schoolopy

:school: Python wrapper for Schoology's REST API.
MIT License
47 stars 19 forks source link

get_group_updates #50

Closed MaxMessinger closed 1 year ago

MaxMessinger commented 1 year ago

Hi, I just started using schoolopy - it's awesome - but I'm not sure how to use .get_group_updates to get more than 200 of the past group updates. Ideally I'd like to retrieve all that have been posted since ~August, if that's possible. Thanks!

ErikBoesen commented 1 year ago

Hey Max, this is indeed possible using the limit and start properties, which respectively control the page size and starting point in the list that you'll retrieve.

sc = schoolopy.Schoology(schoolopy.Auth(cfg['key'], cfg['secret']))
sc.limit = 1000  # Retrieve 1000 objects at a time
sc.start = 2000  # Start the returned list at the 2000th item)
sc.get_group_updates(...)

Let me know if you have any further questions! Thanks for using the package.

MaxMessinger commented 1 year ago

Thanks for the response! I tried implementing that but I've still got the same issue: schoology = schoolopy.Schoology(schoolopy.Auth('', '')) schoology.limit = 1000 schoology.start = 2000 updates = schoology.get_group_updates('') Replacing the key, secret, and group_id, all this is doing is retrieving the most recent 200 updates each time, while I know there are several hundred more to retrieve. Any thoughts?

Thanks!

On Feb 24, 2023, at 13:31, Erik Kieran Boesen @.***> wrote:

Hey Max, this is indeed possible using the limit and start properties, which respectively control the page size and starting point in the list that you'll retrieve.

sc = schoolopy.Schoology(schoolopy.Auth(cfg['key'], cfg['secret'])) sc.limit = 1000 # Retrieve 1000 objects at a time sc.start = 2000 # Start the returned list at the 2000th item) sc.get_group_updates(...) Let me know if you have any further questions! Thanks for using the package.

— Reply to this email directly, view it on GitHub https://github.com/ErikBoesen/schoolopy/issues/50#issuecomment-1444536228, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6CLBOZKP6XIJWKKUTNASVLWZESBJANCNFSM6AAAAAAVFFJNTE. You are receiving this because you authored the thread.

MaxMessinger commented 1 year ago

Never mind, I was able to figure it out. Thanks again though! Loving this module. MaxOn Feb 24, 2023, at 16:12, Max Messinger @.> wrote:Thanks for the response! I tried implementing that but I've still got the same issue:schoology = schoolopy.Schoology(schoolopy.Auth('', ''))schoology.limit = 1000schoology.start = 2000updates = schoology.get_group_updates('')Replacing the key, secret, and group_id, all this is doing is retrieving the most recent 200 updates each time, while I know there are several hundred more to retrieve. Any thoughts?Thanks!On Feb 24, 2023, at 13:31, Erik Kieran Boesen @.> wrote:Hey Max, this is indeed possible using the limit and start properties, which respectively control the page size and starting point in the list that you'll retrieve. sc = schoolopy.Schoology(schoolopy.Auth(cfg['key'], cfg['secret'])) sc.limit = 1000 # Retrieve 1000 objects at a time sc.start = 2000 # Start the returned list at the 2000th item) sc.get_group_updates(...)Let me know if you have any further questions! Thanks for using the package.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

ErikBoesen commented 1 year ago

Sorry for the delay but glad you figured it out! What was the change that resolved the issue you were previously experiencing?

MaxMessinger commented 1 year ago

I ended up setting the start to 1200 and retrieved updates in a loop at 200 each time, decreasing the start by 200 each time as well. The goal was to figure out which user had posted the most Group Updates as well as who made the most-liked post, which ended up working.

On Feb 26, 2023, at 14:13, Erik Kieran Boesen @.***> wrote:

Sorry for the delay but glad you figured it out! What was the change that resolved the issue you were previously experiencing?

— Reply to this email directly, view it on GitHub https://github.com/ErikBoesen/schoolopy/issues/50#issuecomment-1445481557, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6CLBO234EMW6CVOC6FTZZTWZPIQNANCNFSM6AAAAAAVFFJNTE. You are receiving this because you authored the thread.