Skip to content

Commit

Permalink
Merge pull request #7 from jobapis/v1
Browse files Browse the repository at this point in the history
Version 1.0 Release
  • Loading branch information
karllhughes authored Sep 3, 2016
2 parents 6cbf0d6 + 1dc9798 commit 65d54a8
Show file tree
Hide file tree
Showing 12 changed files with 652 additions and 669 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build/
phpunit.xml
composer.lock
vendor
.idea/
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Changelog
All Notable changes to `jobs-indeed` will be documented in this file

## 1.0.0 - 2016-09-02

### Added
- New Composer org name for jobapis, upgraded to v2.

### Fixed
- Updated test namespace.

## 1.0.0-alpha - 2016-09-01

### Added
- Support for v.2 of jobs-common package
- Automatically format results as `json` to prevent parsing failures
- Made "publisher" a required parameter to improve usability

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- `setCity` and `setState` methods

### Security
- Nothing

## 0.4.0 - 2015-08-31

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/jobbrander/jobs-indeed).
We accept contributions via Pull Requests on [Github](https://github.com/jobapis/jobs-indeed).


## Pull Requests
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Apache 2.0 License

Copyright 2015 Steven Maguire <stevenmaguire@gmail.com>
Copyright 2016 Karl Hughes <khughes.me@gmail.com>

> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
Expand Down
89 changes: 52 additions & 37 deletions README.md
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.
13 changes: 9 additions & 4 deletions composer.json
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": [
Expand All @@ -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]",
Expand All @@ -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",
Expand All @@ -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/"
}
}
}
Loading

0 comments on commit 65d54a8

Please sign in to comment.