Mastodon.py icon indicating copy to clipboard operation
Mastodon.py copied to clipboard

account_following limited to 40 entries

Open helioloureiro opened this issue 1 year ago • 2 comments

Hi,

Not sure whether I've some issue, or it is located on the instance (I use mastodon.social), but when I call account_following, I only get 40 entries. And my profile has more than 500.

In [14]: u = tt.mastodon.account_following(id=tt.me.id)

In [15]: len(u)
Out[15]: 40

I tried to set limit as None, but it didn't change much.

Here is my profile at mastodon where you can see it has much higher number of followings:

image

helioloureiro avatar Jul 19 '24 12:07 helioloureiro

And I tried to increase by limit.

In [16]: u = tt.mastodon.account_following(id=tt.me.id, limit=80)

In [17]: len(u)
Out[17]: 80

In [18]: u = tt.mastodon.account_following(id=tt.me.id, limit=500)

In [19]: len(u)
Out[19]: 80

So at the least I'm getting the double as before, but it stills much smaller. Could this be related to https://github.com/halcy/Mastodon.py/issues/300 ?

helioloureiro avatar Jul 19 '24 12:07 helioloureiro

I changed the code to use the result from account_following( ) as argument to fetch_remaining( ) and it did the trick.

So my suggestion for improvement is to inform it on documentation.

In [14]: u = tt.mastodon.account_following(id=tt.me.id, limit=None)

In [15]: len(u)
Out[15]: 40

In [16]: u = tt.mastodon.account_following(id=tt.me.id, limit=80)

In [17]: len(u)
Out[17]: 80

In [18]: u = tt.mastodon.account_following(id=tt.me.id, limit=500)

In [19]: len(u)
Out[19]: 80

In [20]: u2 = tt.mastodon.fetch_remaining(u)

In [21]: len(u2)
Out[21]: 525

helioloureiro avatar Jul 19 '24 12:07 helioloureiro

TODO: improve documentation on pagination somewhat

halcy avatar Dec 01 '24 13:12 halcy

Tried to improve it somewhat.

halcy avatar Feb 14 '25 19:02 halcy