venturocket/venturocket-api-php

Venturocket API的官方PHP客户端

1.0.0 2014-01-10 18:43 UTC

This package is not auto-updated.

Last update: 2024-09-24 02:39:14 UTC


README

这是Venturocket API的官方PHP客户端库。

使用方法

通过Composer安装

php composer.phar require venturocket/venturocket-api-php:~1.0

执行API调用

初始化客户端对象

use Venturocket\Api\Venturocket;
use Venturocket\Api\Listing\Listing;
$venturocket = new Venturocket("your-api-key", "your-api-secret");

关键字调用

// retrieve validity and synonym data for a specific keyword
$keyword = $venturocket->keyword()->getKeyword("php");

// retrieve keyword suggestions based on one or more provided keywords
$suggestions = $venturocket->keyword()->getSuggestions(array("php", "python", "java"));

// parse valid keywords from raw text
$text = "We are looking for rock star web developer with expertise in Javascript and PHP.";
$keywords = $venturocket->keyword()->parseKeywords($text);

列表调用

// create a Listing
$listing = new Listing("a_user_id", Listing::USER_TYPE_PROVIDER, "Your headline here!");
$listing->addKeyword("php", 400, 102);
$listing->addLocation("94105");
$listing->addListingType(Listing::LISTING_TYPE_FULL_TIME);

$listingId = $venturocket->listing()->createListing($listing);

// retrieve a listing
$retrievedListing = $venturocket->listing()->getListing($listingId);

// update a listing
$retrievedListing['userType'] = Listing::USER_TYPE_SEEKER;
$venturocket->listing()->updateListing($listingId, $retrievedListing);

// disable a listing
$venturocket->listing()->disableListing($listingId);

// enable a listing
$venturocket->listing()->enableListing($listingId);

// retrieve matches for a listing
$matches = $venturocket->listing()->getMatches($listingId);