jobapis/jobs-multi 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jobapis/jobs-multi

Composer 安装命令:

composer require jobapis/jobs-multi

包简介

Making it easy to get jobs from multiple job boards.

README 文档

README

Twitter URL Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

About

JobsMulti allows you to easily retrieve job listings from multiple job boards with one library and just a few lines of code.

Each client on its own will give you more flexibility and access to all the parameters for its respective API, but this package allows you to query one or more API in a single call. See Usage section below for 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.

Usage

Prerequisites

Installation

Create a new directory, navigate to it, and install the Jobs Multi package with composer:

composer require jobapis/jobs-multi

Configuration

Create a new file called index.php and open it up in your favorite text editor.

Add the Composer autoload file to the top of the file:

<?php

require __DIR__ . '/vendor/autoload.php';

Create an array of providers you'd like to include. Each "provider" is a job board that Jobs Multi will search for your jobs:

// Include as many or as few providers as you want. Just be sure to include any required keys.

$providers = [
    'Careerbuilder' => [
        'DeveloperKey' => '<YOUR DEVELOPER KEY>',
    ],
    'Careercast' => [],
    'Careerjet' => [
        'affid' => '<YOUR AFFILIATE ID>',
    ],
    'Dice' => [],
    'Github' => [],
    'Govt' => [],
    'Ieee' => [],
    'Indeed' => [
        'publisher' => '<YOUR PUBLISHER ID>',
    ],
    'Jobinventory' => [],
    'J2c' => [
        'id' => '<YOUR PUBLISHER ID>',
        'pass' => '<YOUR PUBLISHER PASSWORD>',
    ],
    'Juju' => [
        'partnerid' => '<YOUR PARTNER ID>',
    ],
    'Monster' => [],
    'Stackoverflow' => [],
    'Usajobs' => [
        'AuthorizationKey' => '<YOUR API KEY>',
    ],
    'Ziprecruiter' => [
        'api_key' => '<YOUR API KEY>',
    ],
];

Job Collection

Next, instantiate the JobsMulti client in your index.php file:

$client = new \JobApis\Jobs\Client\JobsMulti($providers);

Set the parameters for your search. These methods are documented in detail below.

$client->setKeyword('training')
    ->setLocation('chicago, il')
    ->setPage(1, 10);

You can also create an array of $options that will filter your results after they're retrieved from the providers:

$options = [
    'maxAge' => 30,              // Maximum age (in days) of listings
    'maxResults' => 100,         // Maximum number of results
    'orderBy' => 'datePosted',   // Field to order results by
    'order' => 'desc',           // Order ('asc' or 'desc')
];

Then you can retrieve results from each provider individually or from all providers at once:

// Make queries to each individually
$indeedJobs = $client->getJobsByProvider('Indeed');

// Or get an array with results from all the providers at once
$jobs = $client->getAllJobs($options);

For a complete working example, see the example folder in this repository.

The getJobsByProvider and the getAllJobs method will return a Collection containing many Job objects.

Documented Methods

  • setProviders($providers) Set an array of providers you want to use with default and required parameters for each.

  • setKeyword($keyword) Set the search string. For example, "software engineer" or "accountant".

  • setLocation($location) Set the location string. Should be in the format "City, ST". Currently only supports US locations. For example, "Chicago, IL" or "washington, dc".

  • setPage($pageNumber, $perPage) Set the page number and number of results per page for each provider. This means that if you use the getAllJobs() method to retrieve your listings, you will get at most $perPage times the number of providers you choose to search.

  • setOptions($options) Set options for get method. These options will be applied after all results are collected from the providers, so they function more like filters. Options include:

    • maxAge Maximum age (in days) of listings.
    • maxResults Truncate the results to a certain number.
    • order Sort results by asc or desc.
    • orderBy Field to order results by, eg: datePosted.
  • getAllJobs($options) Get a collection of jobs from all providers configured above. See setOptions method above for available options.

  • getJobsByProvider($provider, $options) Get a collection of jobs from a single provider by name. The provider must be in the array of providers. See setOptions method above for available options.

Supported APIs

This package currently supports the following API providers:

If you'd like to add support for another provider, please see the contributing section below.

Testing

  1. Clone this repository from Github.
  2. Install the dependencies with Composer: $ composer install.
  3. Run the test suite: $ ./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.

jobapis/jobs-multi 适用场景与选型建议

jobapis/jobs-multi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.61k 次下载、GitHub Stars 达 56, 最近一次更新时间为 2016 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「jobs」 「api client」 「job boards」 「multiple job boards」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 jobapis/jobs-multi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jobapis/jobs-multi 我们能提供哪些服务?
定制开发 / 二次开发

基于 jobapis/jobs-multi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 57
  • 点击次数: 12
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 56
  • Watchers: 11
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-09-11