Skip to content

Commit

Permalink
Merge pull request #23 from markdunphy/remove-oauth
Browse files Browse the repository at this point in the history
Everything: Clean up a little, remove OAuth, remove non-GET requests, add PSR-4 autoloading, unit tests.
  • Loading branch information
marknotfound committed Oct 10, 2014
2 parents 3547b01 + 2a2283c commit 721653c
Show file tree
Hide file tree
Showing 10 changed files with 1,062 additions and 1,482 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

.DS_Store
vendor
composer.lock
coverage
53 changes: 32 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,52 @@ Basic implementation to access User, Project, Work in Progress and Collection da

See [http://be.net/dev](http://be.net/dev) for more information and documentation.

Authentication
--------------------
Get an API key by registering your application here: [http://be.net/dev/register](http://be.net/dev/register)


Installation / Usage
Install via Composer
--------------------

1. Please register for an application ID + key first: [http://be.net/dev/register](http://be.net/dev/register)
2. Usage.
```json
{
"require": {
"behance/api-network": "~2.0.0"
}
}
```

``` php
require_once( './lib/Be/Api.php' );
Usage
--------------------

$api = new Be_Api( $client_id, $client_secret );
``` php
require_once( './vendor/autoload.php' );

// User data
$api->getUser( 'bryan' );
$client = new Behance\Client( $client_id );

// User's list of projects
$api->getUserProjects( 'bryan' );
// User data
$client->getUser( 'bryan' );

// User's work in progress
$api->getUserWips( 'cfaydi' );
// User's list of projects
$client->getUserProjects( 'bryan' );

// Project data
$api->getProject( 2812719 );
// User's work in progress
$client->getUserWips( 'cfaydi' );

// Project's comments
$api->getProjectComments( 2812719 );
// Project data
$client->getProject( 2812719 );

// Featured project list
$api->searchProjects( array() );
// Project's comments
$client->getProjectComments( 2812719 );

// Featured project list
$client->searchProjects( array() );

// Search for motorcycles
$api->searchProjects( array( 'q' => 'motorcycles' ) );
// Search for motorcycles
$client->searchProjects( array( 'q' => 'motorcycles' ) );

```
```

Requirements
------------
Expand Down
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@
"name": "Michael Klein",
"email": "klein@adobe.com",
"homepage": "https://twitter.com/mikeklein13"
},
{
"name": "Mark Dunphy",
"email": "dunphy@adobe.com",
"homepage": "https://twitter.com/dunphtastic"
}
],
"require": {
"php": ">=5.2.0",
"php": ">=5.3.3",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
},
"autoload": {
"psr-0": {"Be": "lib/"}
"psr-4": {"Behance\\": "src/"}
}
}
Loading

0 comments on commit 721653c

Please sign in to comment.