tinder api的客户端
pynder的Python项目详细描述
这是用于Tinderapi的python客户端。
有关如何使用的更多信息,请参见示例。
首先用facebook id实例化一个pynder.session对象,然后 Facebook访问令牌。
初始化会话后,您将拥有以下方法/属性:
import pynder session = pynder.Session(facebook_id, facebook_auth_token) session.matches() # get users you have already been matched with session.update_location(LAT, LON) # updates latitude and longitude for your profile session.profile # your profile. If you update its attributes they will be updated on Tinder. users = session.nearby_users() # returns a list of users nearby
当您在附近运行_用户时,您将收到一个有希望的对象列表。 它们具有以下属性:
user = users[0] user.bio # their biography user.name # their name user.photos # a list of photo URLs user.thumbnail #a list of thumbnails of photo URLS user.age # their age user.birth_date # their birth_date user.ping_time # last online user.distance_km # distane from you user.common_connections # friends in common user.common_interests # likes in common - returns a list of {'name':NAME, 'id':ID} user.get_photos(width=WIDTH) # a list of photo URLS with either of these widths ["84","172","320","640"] user.instagram_username # instagram username user.instagram_photos # a list of instagram photos with these fields for each photo: 'image','link','thumbnail' user.schools # list of schools user.jobs # list of jobs
您可以对该用户运行user.like(),user.superlike()或user.dislike()。
对于您的匹配项列表,它们将具有与上面相同的属性,除了 你不能不喜欢他们。但是,您可以看到任何交换的消息 (match.messages)或自己发送消息 (match.message(“eyyyy gurl”))。
如果您有任何问题或错误报告,请告诉我。
测试
要运行测试,请将test.ini添加到pynder/tests/文件夹中 Facebook身份验证详细信息:
[FacebookAuth] facebook_id = XXXX facebook_token = YYYY
并安装所需的测试设备:
$ pip install vcrpy nose coverage
现在我们可以运行测试:
$ nosetests pynder --with-coverage --cover-package pynder
注意记录的请求可能包含个人数据,请将其删除 在承诺之前。