Skip to content

Commit

Permalink
Merge pull request #16 from skipperbent/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
skipperbent committed Sep 29, 2016
2 parents 512b48b + c1632aa commit ec8894d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
48 changes: 37 additions & 11 deletions README.md
@@ -1,27 +1,39 @@
# tinder-php-sdk
# Tinder PHP SDK
Easy to use PHP SDK for accessing Tinder data.

**NOTE:**
This SDK is unofficial and based on an unofficial API with no or minimal documentation. Please use with caution as functionality might break or be completely removed each time Tinder changes it's API.

WARNING: NOT FOR PRODUCTION USE!

## Installation
Add the latest version of tinder-php-sdk to your ```composer.json```
Add the latest version of tinder-php-sdk to your project by running

```json
{
"require": {
"pecee/tinder-sdk": "1.*"
}
}
composer require pecee/tinder-sdk
```

## Examples

This section contains basic examples on how to use the SDK.

### Getting your Facebook token
The easiest way to obtain your Facebook token is to visit this link:

**Note:** Your Facebook token will be displayed shortly in the address bar, but hurry up copying it, as the page redirects within a couple of seconds.
The Tinder PHP-SDK requires a valid authorizes Facebook access-token in order to communicate to the Tinder SDK.

Please follow the steps below to obtain your Facebook access-token.

1. Navigate to the following URL.

[https://www.facebook.com/v2.6/dialog/oauth?redirect_uri=fb464891386855067%3A%2F%2Fauthorize%2F&state=%7B%22challenge%22%3A%22q1WMwhvSfbWHvd8xz5PT6lk6eoA%253D%22%2C%220_auth_logger_id%22%3A%2254783C22-558A-4E54-A1EE-BB9E357CC11F%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D&scope=user_birthday%2Cuser_photos%2Cuser_education_history%2Cemail%2Cuser_relationship_details%2Cuser_friends%2Cuser_work_history%2Cuser_likes&response_type=token%2Csigned_request&default_audience=friends&return_scopes=true&auth_type=rerequest&client_id=464891386855067&ret=login&sdk=ios&logger_id=54783C22-558A-4E54-A1EE-BB9E357CC11F#_=](https://www.facebook.com/v2.6/dialog/oauth?redirect_uri=fb464891386855067%3A%2F%2Fauthorize%2F&state=%7B%22challenge%22%3A%22q1WMwhvSfbWHvd8xz5PT6lk6eoA%253D%22%2C%220_auth_logger_id%22%3A%2254783C22-558A-4E54-A1EE-BB9E357CC11F%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D&scope=user_birthday%2Cuser_photos%2Cuser_education_history%2Cemail%2Cuser_relationship_details%2Cuser_friends%2Cuser_work_history%2Cuser_likes&response_type=token%2Csigned_request&default_audience=friends&return_scopes=true&auth_type=rerequest&client_id=464891386855067&ret=login&sdk=ios&logger_id=54783C22-558A-4E54-A1EE-BB9E357CC11F#_=)

[Link here](https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token)
2. Before clicking "OK" open Chrome Developer Tools and click on the "Network" tab. Make sure to filter by XHR requests.

3. Click "OK" to authorize Tinder in the Facebook dialog.

4. Find your access_token like shown in the screenshot below:

![Facebook Access Token](access_token_1.png?raw=true)

### Authentication

Expand Down Expand Up @@ -83,9 +95,23 @@ $tinder->updates();
$tinder->recommendations();
```

### Get friends

View friends from Facebook that have a Tinder profile.

```php
$tinder->friends();
```

### Get Tinder user by id

```php
$tinder->user($userId);
```

## The MIT License (MIT)

Copyright (c) 2015 Simon Sessingø / tinder-php-sdk
Copyright (c) 2016 Simon Sessingø / tinder-php-sdk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file added access_token_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/Pecee/Http/Service/Tinder.php
Expand Up @@ -97,6 +97,14 @@ public function recommendations() {
return $this->api('user/recs');
}

public function friends() {
return $this->api('group/friends');
}

public function user($userId) {
return $this->api('user/' . $userId);
}

/**
* @return object|null
*/
Expand Down

0 comments on commit ec8894d

Please sign in to comment.