Skip to content

Commit

Permalink
Added README
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Jul 9, 2015
1 parent b941d6d commit feb45d2
Showing 1 changed file with 81 additions and 1 deletion.
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,85 @@
[![Latest Stable Version](https://poser.pugx.org/socialconnect/instagram/v/stable.svg)](https://packagist.org/packages/socialconnect/instagram)
[![License](https://poser.pugx.org/SocialConnect/instagram/license.svg)](https://packagist.org/packages/socialconnect/instagram)

Awesome SDK to work with Instagram social network.

![Image](https://ga-beacon.appspot.com/UA-20503308-8/instagram?pixel)
Installation
------------

Add a requirement to your `composer.json`:

```json
{
"require": {
"socialconnect/instagram": "~0.1"
}
}
```

Run the composer installer:

```bash
php composer.phar install
```

How to use
----------

First you need to create service:

```php
// Your Instagram Application's settings
$appId = 'appId';
$appSecret = 'secret';

$instagramClient = new \SocialConnect\Instagram\Client($appId, $appSecret);
$instagramClient->setHttpClient(new \SocialConnect\Common\Http\Client\Curl());
```

## Get user with specified $id:

```php
$instagramClient = $instagramClient->getUser(715473058);
var_dump($user);
```

## Get self information:

```php
$instagramClient = $instagramClient->getUser();
var_dump($user);
```


## Customs methods

```php
$parameters = [];
$result = $instagramClient->request('method/CustomMethod', $parameters);
if ($result) {
var_dump($result);
}
```

## Custom entities

```php
class MyUserEntitiy extends \SocialConnect\Instagram\Entity\User {
public function myOwnMethod()
{
//do something
}
}

$instagramClient->getEntityUser(new MyUserEntitiy());
$user = $instagramClient->getUser(1);

if ($user) {
$instagramClient->myOwnMethod();
}
```

License
-------

This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.

0 comments on commit feb45d2

Please sign in to comment.