exussum12/trip-advisor 问题修复 & 功能扩展

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

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

exussum12/trip-advisor

Composer 安装命令:

composer require exussum12/trip-advisor

包简介

PHP implementation of review API

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality

This is designed to be an easy way in php to use the reviews API from TripAdvisor.

This can be installed using composer for example

composer require exussum12/trip-advisor

Then the most simple method of getting the reviews is as follows

$reviews = new exussum12\TripAdvisor\Reviews('your key', 'your secret');
foreach ($reviews->get() as $review) {
    //handle review
}

The API is paged at a maximum of 1000 reviews per page, This is all handled transparently and will page internally only requesting new data when it is required.

You can set the page size by doing $reviews->limit(50); This will request smaller chucks. If you only want a certain size of data use $reviews->get()->getArray() which will only send one request.

If you are trying to update existing data, use a date range, eg $reviews->since(new DateTime('2017-01-01'))

This will only return the newer reviews.

Options

All options can be chained, together for example

$reviews->offset(100)->limit(50)->since(new DateTime('2017-01-31'));
foreach ($reviews->get() as $review) {
    //handle review
}

Exceptions

A few things can go wrong in this process, The exceptions are named as well as I can think of, All exceptions extend from exussum12\TripAdvisor\Exceptions\BaseException.

The reviews which come back are immutable, So trying to write to any review will throw an exception (ImmutableObjectException)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固