2017 © Pedro Peláez
 

library phpcoderwall

PHP library for fetching Coderwall data

image

mikaelbr/phpcoderwall

PHP library for fetching Coderwall data

  • Wednesday, August 29, 2012
  • by mikaelbr
  • Repository
  • 1 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

phpCoderwall v0.1

Requirements

  • PHP > v.5.3.0
  • Access to request pages (curl or file_get_contents)

For easier installation you should also have composer installed., (*1)

Documentation and Examples

Fetching user information

getUser("mikaelbr", true);

// E.g. use:
echo $user->name;
?>

Notice: The second argument defines if we want to fetch full information about a user. This entails more user properties and full information about the team given user is a part of., (*2)

Properties of the CoderwallUser object

Property Description
username The username of given user.
name Full name of the user.
location Location of the user. E.g. Norway.
endorsements The number of endorsements a user has recived.
team This is a ID to the users team. Can be run through PhpCoderwall#getTeamById() to get full team information.
accounts Collection of all the account types the user has on Coderwall. See more information under properties of the Account object.
badges A collection of CoderwallBadges. See more information about the badges class below.
badgesCount The number of total badges the user has.

Additional properties of the full information CoderwallUser object

Property Description
title Self set title for user.
company What company the user works for
thumbnail URL to the avatar image thumbnail.
specialities Collection of strings. A set of specialities the user has added.
accomplishments Collection of strings. A set of accomplishments the user has added

Properties of the Account object

Property Description
type The account type. Either github, twitter or linkedin
username The users username on the given account type.

Properties of the CoderwallBadge object

Property Description
name The name of the achivement/badge.
description Extended badge description
created A timestamp of when the user recived the badge. E.g. "2012-02-23T19:03:55Z"
badge URL to the badge image.

Fetching team information

getTeam("Github");

// E.g. use:
echo $team->score;
?>

Notice: As per now, the Coderwall's Team API isn't really open and working, so there is a 5 min cache. This means that if you try to first get the Github team and right away the Heroku team, you'll get the Github team information both times. We'll just have to wait until Coderwall releases the Team API to the public., (*3)

Properties of the CoderwallTeam object

Property Description
name The name of the team.
id The teams unique ID.
score Score in the Coderwall leader board.
rank Ranking in the Coderwall leader board.
size Number of team members
slug Filtered team name, used in the Coderwall URL.
avatar URL to the image avatar.
country Collection of strings. With each index a country of the given team.
neighbors Overview of the team neighbors. Collection of simplified CoderwallTeam objects with all properties set, except the following: neighbors and teamMembers
teamMembers Overview of the teams members. Collection of simplified CoderwallUser objects only with the following properties set: username, name, endorsements and badgesCount

Fetching team information by team ID

getTeamById("4f27193d973bf0000400029d");

// E.g. use:
echo $team->name; // Github
?>

Returns a CoderwallTeam object as seen above., (*4)

Installation

Install phpCoderwall by using composer and add a composer.json file to your root, with the following content:, (*5)

{
    "require": {
        "mikaelbr/phpcoderwall": "dev-master"
    }
}

Then run (in the root, with a terminal), depending on your setup, either, (*6)

composer install

or, (*7)

php composer.phar install

With this you can try to run a example as shown above., (*8)


You can also use this library without composer. Just get the code base by cloning the repository, and either write an auto load function or require the files manually., (*9)

The Versions

29/08 2012

dev-master

9999999-dev http://github.com/mikaelbr/phpcoderwall

PHP library for fetching Coderwall data

  Sources   Download

MIT

The Requires

  • php >5.3.0

 

coderwall coderwall api