Awesome
Jobs2Careers Job Board API Client
About
This package makes it easy to connect your PHP project to the Jobs2Careers API. It uses the Jobs Common project to standardize responses using Schema.org's JobPosting specification.
Example
Getting jobs from the API just takes a couple lines of code:
$query = new J2cQuery([
'id' => YOUR_PUBLISHER_ID,
'pass' => YOUR_PUBLISHER_PASSWORD,
'q' => YOUR_KEYWORD_SEARCH,
'l' => YOUR_LOCATION,
]);
$client = new J2cProvider($query);
$jobs = $client->getJobs();
See Usage section below for more detailed examples.
Mission
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.
Requirements
Installation
To install, use composer:
composer require jobapis/jobs-jobs2careers
Usage
Create a Query object and add all the parameters you'd like via the constructor.
// Add parameters to the query via the constructor
$query = new JobApis\Jobs\Client\Queries\J2cQuery([
'id' => YOUR_PUBLISHER_ID,
'pass' => YOUR_PUBLISHER_PASSWORD,
]);
Or via the "set" method. All of the parameters documented in the documentation can be added.
// Add parameters via the set() method
$query->set('q', 'engineering');
You can chain them if you'd like.
// Add parameters via the set() method
$query->set('l', 'Chicago, IL')
->set('start', 10)
->set('limit', 20);
Then inject the query object into the provider.
// Instantiating the Provider with a query object
$client = new JobApis\Jobs\Client\Providers\J2cProvider($query);
And call the "getJobs" method to retrieve results.
// Get a Collection of Jobs
$jobs = $client->getJobs();
The getJobs()
method will return a Collection of Job objects based on Schema.org's JobPosting specification.
Testing
- Clone this repository from Github.
- Install the dependencies with Composer:
$ composer install
. - Run the test suite:
$ ./vendor/bin/phpunit
. - (Optional) To run all tests including actual API calls:
$ ID=<YOUR PUBLISHER ID> PASS=<YOUR PUBLISHER PASSWORD> ./vendor/bin/phpunit
Contributing
Contributions are welcomed and encouraged! Please see JobApis' contribution guidelines for details, or create an issue in Github if you have any questions.
Legal
Disclaimer
This package is not affiliated with or supported by :provider_name and we are not responsible for any use or misuse of this software.
License
This package uses the Apache 2.0 license. Please see the License File for more information.
Copyright
Copyright 2017, Karl Hughes khughes.me@gmail.com.