Coder Social home page Coder Social logo

tinder-scraper's People

Contributors

altskop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tinder-scraper's Issues

Api Changed

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."}

How to add new attributes to output data

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.

BadRequestKeyError(key)

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.