twitter-api-client
twitter-api-client copied to clipboard
list.get_members()
Hi. Any plan to implement more functions for the list endpoint? add_ and remove_ are the bare minimum but there surely must be a way to check the list for a specific member.
Turns out, you had already that in the sights and had the endpoint ready to go. For everybody concerned, adding this to the account.py is enough to pull the list members.
def get_list_members(self, list_id: int, limit=math.inf):
return self._paginate('GET', Operation.ListMembers, {"listId": str(list_id)}, limit)
Thank you @trevorhobenshield. I hope that makes it in the next release.
@codilau How did you that? I have this error when I implemented this in the code
SyntaxWarning: invalid escape sequence '\d' return int(re.findall('"u=(\d+)"', self.session.cookies.get('twid'))[0])
Edit: My bad. I suposse I was from python configuration or something I need add two backlash to d for work.