-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from jobapis/v1
Version 1.0 Release
- Loading branch information
Showing
12 changed files
with
652 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ build/ | |
phpunit.xml | ||
composer.lock | ||
vendor | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,90 @@ | ||
# Indeed Jobs Client | ||
|
||
[![Latest Version](https://img.shields.io/github/release/JobBrander/jobs-indeed.svg?style=flat-square)](https://github.com/JobBrander/jobs-indeed/releases) | ||
[![Latest Version](https://img.shields.io/github/release/jobapis/jobs-indeed.svg?style=flat-square)](https://github.com/jobapis/jobs-indeed/releases) | ||
[![Software License](https://img.shields.io/badge/license-APACHE%202.0-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
[![Build Status](https://img.shields.io/travis/JobBrander/jobs-indeed/master.svg?style=flat-square&1)](https://travis-ci.org/JobBrander/jobs-indeed) | ||
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/JobBrander/jobs-indeed.svg?style=flat-square)](https://scrutinizer-ci.com/g/JobBrander/jobs-indeed/code-structure) | ||
[![Quality Score](https://img.shields.io/scrutinizer/g/JobBrander/jobs-indeed.svg?style=flat-square)](https://scrutinizer-ci.com/g/JobBrander/jobs-indeed) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/jobbrander/jobs-indeed.svg?style=flat-square)](https://packagist.org/packages/jobbrander/jobs-indeed) | ||
[![Build Status](https://img.shields.io/travis/jobapis/jobs-indeed/master.svg?style=flat-square&1)](https://travis-ci.org/jobapis/jobs-indeed) | ||
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/jobapis/jobs-indeed.svg?style=flat-square)](https://scrutinizer-ci.com/g/jobapis/jobs-indeed/code-structure) | ||
[![Quality Score](https://img.shields.io/scrutinizer/g/jobapis/jobs-indeed.svg?style=flat-square)](https://scrutinizer-ci.com/g/jobapis/jobs-indeed) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/jobapis/jobs-indeed.svg?style=flat-square)](https://packagist.org/packages/jobapis/jobs-indeed) | ||
|
||
This package provides [Indeed Jobs API](https://ads.indeed.com/jobroll/xmlfeed) | ||
support for the JobBrander's [Jobs Client](https://github.com/JobBrander/jobs-common). | ||
support for the [Jobs Common Project](https://github.com/jobapis/jobs-common). | ||
|
||
## Installation | ||
|
||
To install, use composer: | ||
|
||
``` | ||
composer require jobbrander/jobs-indeed | ||
composer require jobapis/jobs-indeed | ||
``` | ||
|
||
## Usage | ||
|
||
Usage is the same as Job Branders's Jobs Client, using `\JobBrander\Jobs\Client\Provider\Indeed` as the provider. | ||
|
||
Create a Query object and add all the parameters you'd like via the constructor. | ||
```php | ||
$client = new JobBrander\Jobs\Client\Provider\Indeed([ | ||
'publisher' => 'YOUR INDEED PUBLISHER ID', | ||
'v' => 2, // Optional. Default is 2. | ||
'highlight' => 0, | ||
// Add parameters to the query via the constructor | ||
$query = new JobApis\Jobs\Client\Queries\IndeedQuery([ | ||
'publisher' => YOUR_PUBLISHER_ID | ||
]); | ||
``` | ||
|
||
Or via the "set" method. All of the parameters documented in Indeed's documentation can be added. | ||
|
||
```php | ||
// Add parameters via the set() method | ||
$query->set('q', 'engineering'); | ||
``` | ||
|
||
You can even chain them if you'd like. | ||
|
||
```php | ||
// Add parameters via the set() method | ||
$query->set('l', 'Chicago, IL') | ||
->set('highlight', '1') | ||
->set('latlong', '1'); | ||
``` | ||
|
||
Then inject the query object into the provider. | ||
|
||
$jobs = $client | ||
->setKeyword('project manager') // Query. By default terms are ANDed. To see what is possible, use the [advanced search page](http://www.indeed.com/advanced_search) to perform a search and then check the url for the q value. | ||
->setFormat('json') // Format. Which output format of the API you wish to use. The options are "xml" and "json". If omitted or invalid, the json format is used. | ||
->setCity('Chicago') // City. | ||
->setState('IL') // State. | ||
->setLocation('Chicago, IL') // Location. Use a postal code or a "city, state/province/region" combination. Will overwrite any changes made using setCity and setState | ||
->setSort('date') // Sort by relevance or date. Default is relevance. | ||
->setRadius('100') // Distance from search location ("as the crow flies"). Default is 25. | ||
->setSiteType('jobsite') // Site type. To show only jobs from job boards use "jobsite". For jobs from direct employer websites use "employer". | ||
->setJobType('fulltime') // Job type. Allowed values: "fulltime", "parttime", "contract", "internship", "temporary". | ||
->setPage(2) // Start results at this result number, beginning with 0. Default is 0. | ||
->setCount(200) // Maximum number of results returned per query. Default is 10 | ||
->setDaysBack(10) // Number of days back to search. | ||
->filterDuplicates(false) // Filter duplicate results. 0 turns off duplicate job filtering. Default is 1. | ||
->includeLatLong(true) // If latlong=1, returns latitude and longitude information for each job result. Default is 0. | ||
->setCountry('us') // Search within country specified. Default is us. | ||
->setChannel('channel-one') // Channel Name: Group API requests to a specific channel | ||
->setUserIp($_SERVER['REMOTE_ADDR']) // The IP number of the end-user to whom the job results will be displayed. | ||
->setUserAgent($_SERVER['HTTP_USER_AGENT']) // The User-Agent (browser) of the end-user to whom the job results will be displayed. | ||
->getJobs(); | ||
```php | ||
// Instantiating an IndeedProvider with a query object | ||
$client = new JobApis\Jobs\Client\Provider\IndeedProvider($query); | ||
``` | ||
|
||
The `getJobs` method will return a [Collection](https://github.com/JobBrander/jobs-common/blob/master/src/Collection.php) of [Job](https://github.com/JobBrander/jobs-common/blob/master/src/Job.php) objects. | ||
And call the "getJobs" method to retrieve results. | ||
|
||
```php | ||
// Get a Collection of Jobs | ||
$jobs = $client->getJobs(); | ||
``` | ||
|
||
This will return a [Collection](https://github.com/jobapis/jobs-common/blob/master/src/Collection.php) of [Job](https://github.com/jobapis/jobs-common/blob/master/src/Job.php) objects. | ||
|
||
## Testing | ||
|
||
To run all tests except for actual API calls | ||
``` bash | ||
$ ./vendor/bin/phpunit | ||
``` | ||
|
||
To run all tests including actual API calls | ||
``` bash | ||
$ PUBLISHER=<YOUR PUBLISHER ID> ./vendor/bin/phpunit | ||
``` | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](https://github.com/jobbrander/jobs-indeed/blob/master/CONTRIBUTING.md) for details. | ||
Please see [CONTRIBUTING](https://github.com/jobapis/jobs-indeed/blob/master/CONTRIBUTING.md) for details. | ||
|
||
|
||
## Credits | ||
|
||
- [Steven Maguire](https://github.com/stevenmaguire) | ||
- [All Contributors](https://github.com/jobbrander/jobs-indeed/contributors) | ||
- [Karl Hughes](https://github.com/karllhughes) | ||
- [All Contributors](https://github.com/jobapis/jobs-indeed/contributors) | ||
|
||
|
||
## License | ||
|
||
The Apache 2.0. Please see [License File](https://github.com/jobbrander/jobs-indeed/blob/master/LICENSE) for more information. | ||
The Apache 2.0. Please see [License File](https://github.com/jobapis/jobs-indeed/blob/master/LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "jobbrander/jobs-indeed", | ||
"name": "jobapis/jobs-indeed", | ||
"type": "library", | ||
"description": "Making it simple to integrate your application with Indeed Jobs API.", | ||
"keywords": [ | ||
|
@@ -11,6 +11,11 @@ | |
"homepage": "https://github.com/JobBrander/jobs-indeed", | ||
"license": "Apache-2.0", | ||
"authors": [ | ||
{ | ||
"name": "Karl Hughes", | ||
"email": "[email protected]", | ||
"homepage": "http://www.karllhughes.com" | ||
}, | ||
{ | ||
"name": "Steven Maguire", | ||
"email": "[email protected]", | ||
|
@@ -19,7 +24,7 @@ | |
], | ||
"require": { | ||
"php": ">=5.5.0", | ||
"jobbrander/jobs-common": "~1.0" | ||
"jobapis/jobs-common": "^2.0.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": ">=4.6", | ||
|
@@ -29,12 +34,12 @@ | |
}, | ||
"autoload": { | ||
"psr-4": { | ||
"JobBrander\\Jobs\\Client\\Providers\\": "src/" | ||
"JobApis\\Jobs\\Client\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"JobBrander\\Jobs\\Client\\Providers\\Test\\": "tests/src/" | ||
"JobApis\\Jobs\\Client\\Test\\": "tests/src/" | ||
} | ||
} | ||
} |
Oops, something went wrong.