dawnangel/trovit-api 问题修复 & 功能扩展

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

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

dawnangel/trovit-api

最新稳定版本:v1.0.0

Composer 安装命令:

composer require dawnangel/trovit-api

包简介

A simple PHP implementation of Trovit Affiliates API http://publishers.trovit.com

关键字:

README 文档

README

Latest Stable Version Total Downloads License

A simple PHP implementation of Trovit Affiliates API

Tests Status Build Status

Configuration

Before using this implementation you need to get a API token from the main Trovit Affiliates website:

https://publishers.trovit.com/

First you need to signup as a Trovit Affiliate providing your business details and website.

After their acceptance of your signup, you have to go to the "API Feed" section and provide some information about how you will use this API service for, accept the terms and conditions and in a short time they will provide you with the API token you need.

Usage

First in your code depending if you are using the composer autoload integration or a direct "require" method you need some lines of code.

  • For composer autoload.php:
use DawnAngel\TrovitApi\TrovitApi;

require_once '<VENDOR_DIR>/autoload.php';
  • For direct require:
use DawnAngel\TrovitApi\TrovitApi;

require_once '<TROVIT_API_LIB_DIR>/TrovitApi.php';

You'll need to replace the following "<YOUR-TOKEN-ID>" in the code with your real API token key:

/**
 * TrovitApi Token:
 *
 * Get your Token by signing up in the following url with your details
 *
 * https://publishers.trovit.com/
 */
define('TROVIT_API_TOKEN', '<YOUR-TOKEN-ID>');

// Set TrovitApi Token
TrovitApi::setToken(TROVIT_API_TOKEN);

Then on the point you want to use the API request code:

$apiParams = array(
    // Main params for the request
    'country' => 'es',
    'what'    => 'piso',
    'where'   => '',
    'type'    => '2', /* 1 -> Homes for sale, 2 -> Homes for rent */

    // Filter params for the request
    'region' => 'barcelona',
    'city'   => 'barcelona',

    // Params for API configuration
    'page'     => '1',
    'per_page' => '10',
    'order'    => 'relevance',
);

$ads = TrovitApi::doRequest(TrovitApi::VERTICAL_HOMES, $apiParams);

Thanks for using this library, I hope you enjoy it.

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL2
  • 更新时间: 2014-12-26