Open Gabryxx7 opened 4 years ago
That code isn't valid, were you planning on making a PR?
Sorry I couldn't test it at the time, only looked at the Tinder web version. Might as well make a PR :)
Edit: I also re-checked the code above and it should be good now but a PR is definitely better
@Gabryxx7 Your function returns only the latest message sent. Any idea how to extract the whole conversation?
Hey, yeah I wrote a method to get all the messages in my own fork: https://github.com/Gabryxx7/AI_Dating/blob/349fda890e5852dd9041e5df74bf22fdef582a21/API/tinder_api_extended.py#L415
Given the match_id
you can get messages with this API call:
path = '/v2/matches/%s/messages?locale=en&count=%s' % (match_data["_id"], count)
This will only return the first count
messages, to get the rest you need to pass a page_token
which is given in the response of each call.
The method I wrote is recursive and will automatically merge the results, returning a single json object with all the messages
@Gabryxx7 Thanks Gab. I had a quick look at your AI_Dating. Great Content!
I noticed that all_matches was not working anymore and afater some investigation it looks like it needs some additional parameters:
So now we need to specify
count
which is usually60
on the web version. Not sure whatmessage
is but if it's set to1
the response won't contain thenext_page_token
.Since the method is called
all_matches
I added a little recursive loop to add the matches to the json so that the returned json contains all the matches in thedata
key.