2017 © Pedro Peláez
 

library php-crowdflower

PHP library for interacting with the Crowdflower API v1

image

dadeg/php-crowdflower

PHP library for interacting with the Crowdflower API v1

  • Tuesday, December 16, 2014
  • by dadeg
  • Repository
  • 2 Watchers
  • 11 Stars
  • 1,946 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 14 Versions
  • 24 % Grown

The README.md

PHP Crowdflower API integration.

Code Climate Build Status, (*1)

There are examples of every method of interacting with the CrowdFlower API in the examples folder. The tests are almost at full coverage. I use this package daily and it has been reliable. In order to run the tests yourself you will need to replace the API key in tests/fixtures with your own API key., (*2)

Installation

Add to composer.json

  "dadeg/php-crowdflower": "0.1.*"

Update composer for existing projects

  composer update dadeg/php-crowdflower

Composer install for new projects

  composer install

Getting Started

use CrowdFlower\Account;
$crowd = new Account($apiKey);

Getting existing Jobs

// get list of ten most recent jobs from account
$jobs = $crowd->getJobs();

// get list of ten jobs from account starting at page 2
$jobs = $crowd->getJobs(2);

// get job by job id
$job = $crowd->getJob($jobId);

Creating new Jobs

// create empty job
$job = $crowd->createJob();

// create job with job info
$job = $crowd->createJob(array(
    "title" => "A brand new job",
    "instructions" => "Follow these rules..."
));

// jobs can also be created from a copy of an existing job
$jobCopy = $crowd->getJob($jobId)->copy();

Adding Units

// create units from array
$units = $job->createUnits(array (
  array ("data" => array('column1' => 'value', 'column2' => 'value')),
  array ("data" => array('column1' => 'value2', 'column2' => 'value2'))
));

// units can also be created individually
$unit = $job->createUnit(array('data' => array('column1' => 'value', 'column2' => 'value')));

Adding Orders

// jobs can create orders
$order = $job->createOrder($numberOfUnits, $channels);

Notes

When attributes are updated via the setAttribute() method, the changes are tracked and only those are sent to CrowdFlower when an update is made., (*3)

The Request object is passed as a dependency in order to properly run tests., (*4)

The Versions

16/12 2014

dev-master

9999999-dev

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

16/12 2014

v0.1.1

0.1.1.0

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

22/07 2014

dev-improve-mock-requests

dev-improve-mock-requests

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

14/07 2014

dev-fix-job-update-test

dev-fix-job-update-test

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

11/07 2014

dev-travis-ci

dev-travis-ci

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

11/07 2014

dev-travis

dev-travis

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

11/07 2014

dev-code-climate

dev-code-climate

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

10/07 2014

dev-update_job_test

dev-update_job_test

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

10/07 2014

dev-job_tests

dev-job_tests

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

09/07 2014

dev-fix_account_tests

dev-fix_account_tests

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

09/07 2014

dev-account_test

dev-account_test

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

09/07 2014

dev-crowdflower_test

dev-crowdflower_test

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

08/07 2014

dev-examples

dev-examples

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef

08/07 2014

dev-request

dev-request

PHP library for interacting with the Crowdflower API v1

  Sources   Download

The Development Requires

by Dennis Heckman
by Dan DeGreef