This repository is to be used as a skeleton for setting up new job board API clients, and it includes information on how to go about creating a new client. This repository is loosely based on the PHP League's Skeleton project.
If you have questions, create an issue in the Github repository and we will try to resolve it as quickly as possible.
README.md
Instructions for setting up, testing, and using the package with examples of working code.CHANGELOG.md
A record of changes to the package.composer.json
The standard composer package for job board API clients. Individual clients may require additional packages or scripts.phpunit.xml.dist
The standard PHPUnit configuration file..scrutinizer.yml
The standard Scrutinizer configuration file..travis.yml
The standard Travis configuration file.src/
This directory contains the Query and Provider classes for the new client.tests/src/
This directory contains tests for the Query and Provider classes.
All JobApis clients rely on the low-level Jobs Common package, and should use the latest version. Jobs Common handles most of the heavy lifting, but your new client package will need to provide Query
and Provider
classes. The Query
class contains the root URL of the API, all the API query parameters, and details about default and required values.
The Provider
class will use the Query
to make a call to the API and parse the results. Most of the work you have to do as a developer is map the API's response to the Job Object attributes. While the bulk of the work is in the Query
and Provider
classes, here is a checklist of things that should be done when setting up a new package:
- Replace
:package_name
,:provider_name
,:author_name
, and:author_link
with the appropriate values incomposer.json
,README.md
, andCHANGELOG.md
. - Update the name of the
SkeletonQuery
class to the new client's name. - Add all the abstract methods and API parameters to the
Query
class. - Add tests for the
Query
class to thetests/src
directory. - Update the name of the
SkeletonProvider
class to the new client's name. - Add all the abstract methods and API parameters to the
Provider
class. - Add tests for the
Provider
class to thetests/src
directory. - Add the package to Packagist.
- Set up Travis and Scrutinizer to run linting and tests.
- Tag a new release on Github.
Remove everything above this line when creating a new client.
This is where you write a couple sentences describing this package. Link to the job board's API docs and website if possible.
Update this example as necessary.
$client = new SkeletonProvider(new SkeletonQuery());
$jobs = $client->getJobs();
See Usage section below for more detailed examples.
JobApis makes job board and company data more accessible through open source software. To learn more, visit JobApis.com, or contact us at admin@jobapis.com.
You can install this package using Composer. From the command line, run:
$ composer require jobapis/:package_name
Detailed usage examples go here. Update this section based on the package's parameters.
$query = new JobApis\Jobs\Client\Queries\SkeletonQuery();
Then inject the query object into the provider.
$client = new JobApis\Jobs\Client\Providers\SkeletonProvider($query);
And call the "getJobs" method to retrieve results.
$jobs = $client->getJobs();
The getJobs()
method will return a Collection of Job objects based on Schema.org's JobPosting specification.
- Clone this repository from Github.
- Install the dependencies with Composer:
$ composer install
. - Run the test suite:
$ ./vendor/bin/phpunit
. - (Optional) Run the test suite with real HTTP calls to the API:
$ REAL_CALL=1 ./vendor/bin/phpunit
.
A code coverage report will be generated in the build/
directory at the root of the project.
Contributions are welcomed and encouraged! Please see JobApis' contribution guidelines for details, or create an issue in Github if you have any questions.
This package is not affiliated with or supported by :provider_name and we are not responsible for any use or misuse of this software.
This package uses the Apache 2.0 license. Please see the License File for more information.
Copyright 2017, :author_name.