Skip to content

Commit

Permalink
Merge pull request #8 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 fa5153e + b770f0a commit 9293603
Show file tree
Hide file tree
Showing 12 changed files with 511 additions and 511 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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Changelog
All Notable changes to `jobs-govt` will be documented in this file

## 1.0.0 - 2016-09-03

### Added
- Updated package name in composer file.

### Fixed
- Test namespace.

## 1.0.0-beta - 2016-09-02

### Added
- Changed namespace and organization to `jobapis`.
- Support for v2 of jobs-common package.

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- Old getters and setters.

### Security
- Nothing

## 0.6.0 - 2015-09-28

### 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-govt).


## 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 Karl Hughes <khughes.me@gmail.com>, Steven Maguire <stevenmaguire@gmail.com>
Copyright 2016 Karl Hughes <[email protected]>

> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
Expand Down
75 changes: 42 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,67 @@
# Government Jobs Client

[![Latest Version](https://img.shields.io/github/release/JobBrander/jobs-govt.svg?style=flat-square)](https://github.com/JobBrander/jobs-govt/releases)
[![Latest Version](https://img.shields.io/github/release/jobapis/jobs-govt.svg?style=flat-square)](https://github.com/jobapis/jobs-govt/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-govt/master.svg?style=flat-square&1)](https://travis-ci.org/JobBrander/jobs-govt)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/JobBrander/jobs-govt.svg?style=flat-square)](https://scrutinizer-ci.com/g/JobBrander/jobs-govt/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/JobBrander/jobs-govt.svg?style=flat-square)](https://scrutinizer-ci.com/g/JobBrander/jobs-govt)
[![Total Downloads](https://img.shields.io/packagist/dt/jobbrander/jobs-govt.svg?style=flat-square)](https://packagist.org/packages/jobbrander/jobs-govt)
[![Build Status](https://img.shields.io/travis/jobapis/jobs-govt/master.svg?style=flat-square&1)](https://travis-ci.org/jobapis/jobs-govt)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/jobapis/jobs-govt.svg?style=flat-square)](https://scrutinizer-ci.com/g/jobapis/jobs-govt/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/jobapis/jobs-govt.svg?style=flat-square)](https://scrutinizer-ci.com/g/jobapis/jobs-govt)
[![Total Downloads](https://img.shields.io/packagist/dt/jobapis/jobs-govt.svg?style=flat-square)](https://packagist.org/packages/jobapis/jobs-govt)

This package provides [Government Jobs API](http://search.digitalgov.gov/developer/jobs.html)
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-govt
composer require jobapis/jobs-govt
```

## Usage

Usage is the same as Job Branders's Jobs Client, using `\JobBrander\Jobs\Client\Provider\Govt`
as the provider.
Create a Query object and add all the parameters you'd like via the constructor.

```php
// Add parameters to the query via the constructor
$query = new JobApis\Jobs\Client\Queries\GovtQuery([
'hl' => '1'
]);
```

Or via the "set" method. All of the parameters documented in the API's documentation can be added.

```php
$client = new JobBrander\Jobs\Client\Provider\Govt();

// Search for 200 job listings for 'project manager' in Chicago, IL
$jobs = $client
// API parameters
->setQuery() // Attempts to extract as much "signal" as possible from the input text. Handles word variants, so a search on "nursing jobs" will find a job titled "nurse practitioner" and "RN." When parts of the query parameter are used to search against the position title, the results are ordered by relevance. When no query parameter is specified, they are ordered by date with the most recent listed first.
->setOrganizationIds() // A comma-separated string specifying which federal, state, or local agencies to use as a filter.
->setHl() // No highlighting is included by default. Use 'hl=1' to highlight terms in the position title that match terms in the user's search.
->setSize() // Specifies how many results are returned (up to 100 at a time).
->setFrom() // Specifies the starting record.
->setTags() // A comma-separated string specifying the level of government. Current tags are federal, state, county, and city.
->setLatLon() // Comma-separated pair denoting the position of the searcher looking for a job. For example, 'lat_lon=37.783333,-122.416667' is the value for San Francisco, CA.
// Jobbrander parameters
->setKeyword('project manager') // See "setQuery()" method above
->setCount(100) // See "setSize()" method above
->getJobs();
// Add parameters via the set() method
$query->set('query', 'engineering');
```

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.
You can even chain them if you'd like.

```php
// Add parameters via the set() method
$query->set('size', '100')
->set('from', '200');
```

### Location Queries
*Note: The government jobs API doesn't support adding location as a parameter, but their keyword or lat_lon parameters can be used for this purpose.*

Because this API does not support location-based queries, you will need to add the location
to your setKeyword() method call. For example:
Then inject the query object into the provider.

```php
// Instantiating provider with a query object
$client = new JobApis\Jobs\Client\Provider\GovtProvider($query);
```
$jobs = $client->setKeyword('project manager in chicago, il')->getJobs();

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

``` bash
Expand All @@ -61,14 +70,14 @@ $ ./vendor/bin/phpunit

## Contributing

Please see [CONTRIBUTING](https://github.com/jobbrander/jobs-govt/blob/master/CONTRIBUTING.md) for details.
Please see [CONTRIBUTING](https://github.com/jobapis/jobs-govt/blob/master/CONTRIBUTING.md) for details.

## Credits

- [Steven Maguire](https://github.com/stevenmaguire)
- [Karl Hughes](https://github.com/karllhughes)
- [All Contributors](https://github.com/jobbrander/jobs-govt/contributors)
- [All Contributors](https://github.com/jobapis/jobs-govt/contributors)

## License

The Apache 2.0. Please see [License File](https://github.com/jobbrander/jobs-govt/blob/master/LICENSE) for more information.
The Apache 2.0. Please see [License File](https://github.com/jobapis/jobs-govt/blob/master/LICENSE) for more information.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jobbrander/jobs-govt",
"name": "jobapis/jobs-govt",
"type": "library",
"description": "Making it simple to integrate your application with the Government Jobs API.",
"keywords": [
Expand All @@ -8,23 +8,23 @@
"object",
"government jobs"
],
"homepage": "https://github.com/JobBrander/jobs-govt",
"homepage": "https://github.com/jobapis/jobs-govt",
"license": "Apache-2.0",
"authors": [
{
"name": "Steven Maguire",
"email": "[email protected]",
"homepage": "https://github.com/stevenmaguire"
},
{
"name": "Karl Hughes",
"email": "[email protected]",
"homepage": "https://github.com/karllhughes"
},
{
"name": "Steven Maguire",
"email": "[email protected]",
"homepage": "https://github.com/stevenmaguire"
}
],
"require": {
"php": ">=5.5.0",
"jobbrander/jobs-common": "~1.0.3"
"jobapis/jobs-common": "^2.0.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.6",
Expand All @@ -34,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 9293603

Please sign in to comment.