Skip to content

Commit

Permalink
Fixed following list
Browse files Browse the repository at this point in the history
 - it was retrieving only 40 entries
   because... not sure but it seems
   to be some limitation from Mastodon.py
   itself
  • Loading branch information
helioloureiro committed Jul 19, 2024
1 parent 7303b00 commit 0285fa4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mastodon-toot-thursday.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __init__(self, userid):


def getFollowing(self):
self.followingList = [ user.acct for user in self.mastodon.account_following(id=self.me.id)]
reference = self.mastodon.account_following(id=self.me.id)
following = self.mastodon.fetch_remaining(reference)
self.followingList = [ user.acct for user in following]
print(self.followingList)

def doTheLottery(self):
Expand All @@ -47,10 +49,15 @@ def doTheLottery(self):

def send(self):
text = '#TT \n'
footer = '\n#TootThursday'
size_limit = 500 # from mastodon page
for username in self.followingList:
text += '@' + username + '\n'
text += '\n#TootThursday'

username = '@' + username + '\n'
## check message limit at every entry
if len(text + username + footer) > size_limit:
break
text += username
text += footer
self.mastodon.toot(text)


Expand Down

0 comments on commit 0285fa4

Please sign in to comment.