forked from tobvil/TinderAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvoke-TinderLiker.ps1
More file actions
55 lines (55 loc) · 2.23 KB
/
Invoke-TinderLiker.ps1
File metadata and controls
55 lines (55 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function Get-TinderToken
{
Invoke-RestMethod -Uri "https://api.gotinder.com/v2/auth/sms/send?auth_type=sms&locale=en" -Method "POST" -ContentType "application/json" -Body "{`"phone_number`":`"$PhoneNumber`"}"
$SMSCode = Read-Host "Enter SMS Code"
$RequestValidate = Invoke-RestMethod -Uri "https://api.gotinder.com/v2/auth/sms/validate?auth_type=sms&locale=en" -Method "POST" -ContentType "application/json" -Body "{`"otp_code`":`"$SMSCode`",`"phone_number`":`"$PhoneNumber`"}"
$RefreshToken = $requestvalidate.data.refresh_token
$RequestToken = Invoke-RestMethod -Uri "https://api.gotinder.com/v2/auth/login/sms?locale=en" -Method "POST" -ContentType "application/json" -Body "{`"refresh_token`":`"$RefreshToken`",`"phone_number`":`"$PhoneNumber`"}"
$Script:TinderToken = $requesttoken.data.api_token
}
function Invoke-TinderLiker
{
Get-TinderToken
$Headers = @{"X-Auth-Token" = "$TinderToken"}
while ($True)
{
try
{
$RecommendationRequest = Invoke-RestMethod -Method Post -Uri "https://api.gotinder.com/user/recs" -Headers $Headers -ContentType application/json
$Results = $RecommendationRequest.results
}
catch
{
Write-Error "Couldn't find new recommendations" -ErrorAction Stop
}
foreach ($R in $Results)
{
$Id = $R._id
$ImageURL = $R.photos.Url | Select-Object -First 1
$Name = $R.name
do
{
try
{
$LikeRequest = Invoke-RestMethod -Method Get -Uri "https://api.gotinder.com/like/$ID" -Headers $Headers -ContentType applictaion/json
}
catch
{
Write-Error "$_ - Trying again :)"
}
} while (-not $LikeRequest)
if ($LikeRequest.match -eq 'True')
{
Write-Output "Yaaay you matched with $Name `n$ImageURL"
}
else
{
Write-Output "Liking $Name `n$ImageURL"
}
$i++
Write-Output "Like Count $i`n"
}
}
}
$PhoneNumber = Read-Host "Enter country code + phone number e.g. 4588888888"
Invoke-TinderLiker