2017 © Pedro Peláez
 

library activity

Activity lets you list your current activity on Github. Soon from Bitbucket as well.

image

nwidart/activity

Activity lets you list your current activity on Github. Soon from Bitbucket as well.

  • Friday, April 17, 2015
  • by nWidart
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License SensioLabsInsight, (*1)

Activity

Activity lets you list your current activity on Github. Soon from Bitbucket as well., (*2)

Important note, (*3)

Keep in mind this package is still in W.I.P., meaning not all event types are implemented yet., (*4)

The event types not implemented yet:, (*5)

  • ForkEvent
  • PublicEvent
  • ReleaseEvent

Events available:, (*6)

  • CreateEvent
  • DeleteEvent
  • IssueCommentEvent
  • PullRequestEvent
  • PushEvent
  • WatchEvent
  • IssuesEvent
  • CommitCommentEvent
  • GollumEvent
  • PullRequestReviewCommentEvent

Installation

Add the following in you composer.json file:, (*7)

{
    "require": {
        "nwidart/activity": "dev-master"
    }
}

Add the service provider in app/config/app.php, (*8)

'providers' => [
    ...
    'Nwidart\Activity\ActivityServiceProvider'
]

Next add the Facade:, (*9)

'aliases' => [
    ...
    'Activity'          => 'Nwidart\Activity\ActivityFacade',
]

Finally publish the configuration file:, (*10)

php artisan config:publish Nwidart/activity

And add your Github Application token., (*11)

Usage

The usage is very simple and straightforward., (*12)

Constructor/method injection

public function __construct(Activity $activity)
{
    $this->activity = $activity;
}

public function getIndex()
{
    $activities = $this->activity->forUser('nwidart')->activities();
}

The activities method accepts integer that represents the limit of activities. It defaults to 5., (*13)

Using the Facade

$activities = ActivityFacade::forUser('nwidart')->activities();

The response will be:, (*14)

array (size=5)
  0 =>
    array (size=6)
      'time' => string '2 hours ago' (length=11)
      'actor' => string 'nWidart' (length=7)
      'actor_avatar' => string 'https://avatars.githubusercontent.com/u/882397?' (length=47)
      'verb' => string 'pushed to ' (length=10)
      'action_object' => string 'nWidart/portfolio' (length=17)
      'target' => string 'https://github.com/nWidart/portfolio/commit/5fae34f185d7b52e4de4c3597df7218af024c9e1' (length=84)
  1 =>
    array (size=6)
      'time' => string '8 hours ago' (length=11)
      'actor' => string 'nWidart' (length=7)
      'actor_avatar' => string 'https://avatars.githubusercontent.com/u/882397?' (length=47)
      'verb' => string 'pushed to ' (length=10)
      'action_object' => string 'nWidart/portfolio' (length=17)
      'target' => string 'https://github.com/nWidart/portfolio/commit/bba88e3d9bbaa1c13e98100d3da7fa3becbbd3f1' (length=84)
  2 =>
    array (size=6)
      'time' => string '8 hours ago' (length=11)
      'actor' => string 'nWidart' (length=7)
      'actor_avatar' => string 'https://avatars.githubusercontent.com/u/882397?' (length=47)
      'verb' => string 'pushed to ' (length=10)
      'action_object' => string 'nWidart/portfolio' (length=17)
      'target' => string 'https://github.com/nWidart/portfolio/commit/275c0627c449eb3370bf50e46bad8987d74e1c9a' (length=84)
  3 =>
    array (size=6)
      'time' => string '8 hours ago' (length=11)
      'actor' => string 'nWidart' (length=7)
      'actor_avatar' => string 'https://avatars.githubusercontent.com/u/882397?' (length=47)
      'verb' => string 'pushed to ' (length=10)
      'action_object' => string 'nWidart/portfolio' (length=17)
      'target' => string 'https://github.com/nWidart/portfolio/commit/beba6f74cd40eef52a46195026e80d136beb90ee' (length=84)
  4 =>
    array (size=6)
      'time' => string '13 hours ago' (length=12)
      'actor' => string 'nWidart' (length=7)
      'actor_avatar' => string 'https://avatars.githubusercontent.com/u/882397?' (length=47)
      'verb' => string 'pushed to ' (length=10)
      'action_object' => string 'nWidart/portfolio' (length=17)
      'target' => string 'https://github.com/nWidart/portfolio/commit/7c23584cd4dca9eea529a15fc61da0afe2ea0485' (length=84)

License (MIT)

Copyright (c) 2013 Nicolas Widart , n.widart@gmail.com, (*15)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*16)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*17)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*18)

The Versions

17/04 2015

dev-master

9999999-dev

Activity lets you list your current activity on Github. Soon from Bitbucket as well.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel github activity bitbucket