altskop / tinder-scraper Goto Github PK
View Code? Open in Web Editor NEWScript to scrape public Tinder profiles' information
License: MIT License
Script to scrape public Tinder profiles' information
License: MIT License
Is this repo is broken or did I do something wrong? I entered my info in the config but did not get authorized after running scraper.py.
Api has changed. Easy fix, just change the following lines from tinder_api.py
def get_auth_token(fb_auth_token, fb_user_id):
if "error" in fb_auth_token:
return {"error": "could not retrieve fb_auth_token"}
if "error" in fb_user_id:
return {"error": "could not retrieve fb_user_id"}
url = config.host + '/auth'
###CHANGES BELOW THIS LINE###
req = requests.post("https://api.gotinder.com/v2/auth/login/facebook",
headers=headers,
data=json.dumps({'token': fb_auth_token, 'facebook_id': fb_user_id})
)
try:
tinder_auth_token = req.json()["data"]["api_token"]
###CHANGES ABOVE THIS LINE###
headers.update({"X-Auth-Token": tinder_auth_token})
print("You have been successfully authorized!")
return tinder_auth_token
except Exception as e:
print(e)
return {"error": "Something went wrong. Sorry, but we could not authorize you."}
Hey,
I've been tinkering around the code however couldn't find a way of adding the following attributes to each row of data:
api.get_self()['gender']
api.get_self()['interested_in']
Can anyone point me in the right direction as to edit where in scraper.py? Basically i want to add the above values to each piece of data i collect.
I tried to edit get_match_info() in scraper.py but it didn't work out.
def get_match_info():
matches = api.get_updates()['matches']
now = datetime.utcnow()
match_info = {}
for match in matches[:len(matches)]:
try:
person = match['person']
person_id = person['_id'] # This ID for looking up person
match_info[person_id] = {
"name": person['name'],
"match_id": match['id'], # This ID for messaging
"message_count": match['message_count'],
"photos": get_photos(person),
"bio": person['bio'],
"gender": person['gender'],
"avg_successRate": get_avg_successRate(person),
"messages": match['messages'],
"age": calculate_age(match['person']['birth_date']),
"distance": api.get_person(person_id)['results']['distance_mi'],
"last_activity_date": match['last_activity_date'],
###ADDED THE 2 ROWS BELOW###
"self_gender": api.get_self()['gender'],
"self_interest": api.get_self()['interested_in'],
###ADDED THE 2 ROWS ABOVE###
}
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
print(message)
# continue
print("All data stored in variable: match_info")
return match_info
For some reason i can't figure out it doesn't append the added values.
Hello, I understand that this scrapper is quite old, but maybe there is possibility to fix this issue, I would appreciate if you could give me an advice, thank you -->
Traceback (most recent call last):
File "scraper.py", line 11, in <module>
import tinder_api as api
File "C:\Users\User\PycharmProjects\tinder-scraper\tinder_api.py", line 4, in <module>
import config
File "C:\Users\User\PycharmProjects\tinder-scraper\config.py", line 8, in <module>
fb_access_token = fb_auth_token.get_fb_access_token(fb_username, fb_password)
File "C:\Users\User\PycharmProjects\tinder-scraper\fb_auth_token.py", line 16, in get_fb_access_token
f["pass"] = password
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\robobrowser\forms\form.py", line 216, in __setitem__
self.fields[key].value = value
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\werkzeug\datastructures.py", line 795, in __getitem__
raise exceptions.BadRequestKeyError(key)
werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
PS C:\Users\User\PycharmProjects\tinder-scraper>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.