@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | $client = new Client(); |
| 8 | 8 | $client->authenticate( |
| 9 | - $config->github->client_id, |
|
| 10 | - $config->github->client_secret, |
|
| 11 | - Client::AUTH_URL_CLIENT_ID |
|
| 9 | + $config->github->client_id, |
|
| 10 | + $config->github->client_secret, |
|
| 11 | + Client::AUTH_URL_CLIENT_ID |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | /********************************************* |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | *********************************************/ |
| 17 | 17 | $commits = $client->api('repo')->commits()->all('jacobemerick', 'web', ['sha' => 'master']); |
| 18 | 18 | foreach ($commits as $commit) { |
| 19 | - echo "Message: ", $commit['commit']['message'], PHP_EOL; |
|
| 20 | - echo "Short Message: ", 'todo', PHP_EOL; |
|
| 21 | - echo "Date: ", $commit['commit']['author']['date'], PHP_EOL; |
|
| 22 | - echo "Author: ", $commit['commit']['author']['name'], PHP_EOL; |
|
| 23 | - echo "Link: ", $commit['html_url'], PHP_EOL; |
|
| 24 | - echo PHP_EOL; |
|
| 19 | + echo "Message: ", $commit['commit']['message'], PHP_EOL; |
|
| 20 | + echo "Short Message: ", 'todo', PHP_EOL; |
|
| 21 | + echo "Date: ", $commit['commit']['author']['date'], PHP_EOL; |
|
| 22 | + echo "Author: ", $commit['commit']['author']['name'], PHP_EOL; |
|
| 23 | + echo "Link: ", $commit['html_url'], PHP_EOL; |
|
| 24 | + echo PHP_EOL; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~', PHP_EOL; |
@@ -31,30 +31,30 @@ discard block |
||
| 31 | 31 | *********************************************/ |
| 32 | 32 | $events = $client->api('user')->publicEvents('jacobemerick'); |
| 33 | 33 | foreach ($events as $event) { |
| 34 | - if ( |
|
| 35 | - $event['type'] == 'DeleteEvent' || |
|
| 36 | - $event['type'] == 'IssueCommentEvent' || |
|
| 37 | - $event['type'] == 'ReleaseEvent' |
|
| 38 | - ) { |
|
| 39 | - continue; |
|
| 40 | - } |
|
| 41 | - echo "Type: ", $event['type'], PHP_EOL; |
|
| 42 | - echo "Repo: ", $event['repo']['name'], PHP_EOL; |
|
| 43 | - echo "Date: ", $event['created_at'], PHP_EOL; |
|
| 44 | - if ($event['type'] == 'CreateEvent') { |
|
| 45 | - echo " Created a new ", $event['payload']['ref_type'], ", name ", $event['payload']['ref'], PHP_EOL; |
|
| 46 | - } |
|
| 47 | - if ($event['type'] == 'ForkEvent') { |
|
| 48 | - echo " Forked to ", $event['payload']['forkee']['name'], PHP_EOL; |
|
| 49 | - } |
|
| 50 | - if ($event['type'] == 'PullRequestEvent') { |
|
| 51 | - echo ' ', ucwords($event['payload']['action']), ' a pull request to ', $event['payload']['pull_request']['base']['repo']['name'], PHP_EOL; |
|
| 52 | - echo ' Message: ', $event['payload']['pull_request']['body'], PHP_EOL; |
|
| 53 | - } |
|
| 54 | - if ($event['type'] == 'PushEvent') { |
|
| 55 | - foreach ($event['payload']['commits'] as $commit) { |
|
| 56 | - echo " Commit: ", $commit['message'], PHP_EOL; |
|
| 57 | - } |
|
| 58 | - } |
|
| 59 | - echo PHP_EOL; |
|
| 34 | + if ( |
|
| 35 | + $event['type'] == 'DeleteEvent' || |
|
| 36 | + $event['type'] == 'IssueCommentEvent' || |
|
| 37 | + $event['type'] == 'ReleaseEvent' |
|
| 38 | + ) { |
|
| 39 | + continue; |
|
| 40 | + } |
|
| 41 | + echo "Type: ", $event['type'], PHP_EOL; |
|
| 42 | + echo "Repo: ", $event['repo']['name'], PHP_EOL; |
|
| 43 | + echo "Date: ", $event['created_at'], PHP_EOL; |
|
| 44 | + if ($event['type'] == 'CreateEvent') { |
|
| 45 | + echo " Created a new ", $event['payload']['ref_type'], ", name ", $event['payload']['ref'], PHP_EOL; |
|
| 46 | + } |
|
| 47 | + if ($event['type'] == 'ForkEvent') { |
|
| 48 | + echo " Forked to ", $event['payload']['forkee']['name'], PHP_EOL; |
|
| 49 | + } |
|
| 50 | + if ($event['type'] == 'PullRequestEvent') { |
|
| 51 | + echo ' ', ucwords($event['payload']['action']), ' a pull request to ', $event['payload']['pull_request']['base']['repo']['name'], PHP_EOL; |
|
| 52 | + echo ' Message: ', $event['payload']['pull_request']['body'], PHP_EOL; |
|
| 53 | + } |
|
| 54 | + if ($event['type'] == 'PushEvent') { |
|
| 55 | + foreach ($event['payload']['commits'] as $commit) { |
|
| 56 | + echo " Commit: ", $commit['message'], PHP_EOL; |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | + echo PHP_EOL; |
|
| 60 | 60 | } |