Skip to content

Commit 721653c

Browse files
committed
Merge pull request #23 from markdunphy/remove-oauth
Everything: Clean up a little, remove OAuth, remove non-GET requests, add PSR-4 autoloading, unit tests.
2 parents 3547b01 + 2a2283c commit 721653c

File tree

10 files changed

+1062
-1482
lines changed

10 files changed

+1062
-1482
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
21
.DS_Store
2+
vendor
3+
composer.lock
4+
coverage

README.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,52 @@ Basic implementation to access User, Project, Work in Progress and Collection da
77

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

10+
Authentication
11+
--------------------
12+
Get an API key by registering your application here: [http://be.net/dev/register](http://be.net/dev/register)
13+
1014

11-
Installation / Usage
15+
Install via Composer
1216
--------------------
1317

14-
1. Please register for an application ID + key first: [http://be.net/dev/register](http://be.net/dev/register)
15-
2. Usage.
18+
```json
19+
{
20+
"require": {
21+
"behance/api-network": "~2.0.0"
22+
}
23+
}
24+
```
1625

17-
``` php
18-
require_once( './lib/Be/Api.php' );
26+
Usage
27+
--------------------
1928

20-
$api = new Be_Api( $client_id, $client_secret );
29+
``` php
30+
require_once( './vendor/autoload.php' );
2131

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

25-
// User's list of projects
26-
$api->getUserProjects( 'bryan' );
34+
// User data
35+
$client->getUser( 'bryan' );
2736

28-
// User's work in progress
29-
$api->getUserWips( 'cfaydi' );
37+
// User's list of projects
38+
$client->getUserProjects( 'bryan' );
3039

31-
// Project data
32-
$api->getProject( 2812719 );
40+
// User's work in progress
41+
$client->getUserWips( 'cfaydi' );
3342

34-
// Project's comments
35-
$api->getProjectComments( 2812719 );
43+
// Project data
44+
$client->getProject( 2812719 );
3645

37-
// Featured project list
38-
$api->searchProjects( array() );
46+
// Project's comments
47+
$client->getProjectComments( 2812719 );
3948

49+
// Featured project list
50+
$client->searchProjects( array() );
4051

41-
// Search for motorcycles
42-
$api->searchProjects( array( 'q' => 'motorcycles' ) );
52+
// Search for motorcycles
53+
$client->searchProjects( array( 'q' => 'motorcycles' ) );
4354

44-
```
55+
```
4556

4657
Requirements
4758
------------

composer.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@
1515
"name": "Michael Klein",
1616
"email": "klein@adobe.com",
1717
"homepage": "https://twitter.com/mikeklein13"
18+
},
19+
{
20+
"name": "Mark Dunphy",
21+
"email": "dunphy@adobe.com",
22+
"homepage": "https://twitter.com/dunphtastic"
1823
}
1924
],
2025
"require": {
21-
"php": ">=5.2.0",
26+
"php": ">=5.3.3",
2227
"ext-curl": "*"
2328
},
29+
"require-dev": {
30+
"phpunit/phpunit": "4.3.*"
31+
},
2432
"autoload": {
25-
"psr-0": {"Be": "lib/"}
33+
"psr-4": {"Behance\\": "src/"}
2634
}
2735
}

0 commit comments

Comments
 (0)