twitter-api-client icon indicating copy to clipboard operation
twitter-api-client copied to clipboard

list.get_members()

Open codilau opened this issue 1 year ago • 2 comments

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.

codilau avatar Jul 20 '23 10:07 codilau

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 avatar Jul 20 '23 17:07 codilau

@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.

Jrublgo avatar Jan 27 '24 13:01 Jrublgo