ben-gibson/foursquare-venue-client

一个用于访问 Foursquare 无用户场馆端点的 PHP 客户端库。

v0.0.6 2017-03-04 17:15 UTC

This package is not auto-updated.

Last update: 2024-09-15 02:22:01 UTC


README

Join the chat at https://gitter.im/foursquare-venue-client/Lobby

Latest Version on Packagist Software License Build Status Total Downloads

一个用于与 Foursquare 无用户场馆 API 交互的 PHP 客户端库。使用 HTTPlug 支持多个 HTTP 客户端,包括 GuzzleBuzzCurl

安装

使用 composer 安装此库以及您首选的 HTTP 客户端。

$ composer require php-http/guzzle6-adapter
$ composer require ben-gibson/foursquare-venue-client

使用方法

<?php

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

use Gibbo\Foursquare\Client\Client;
use Gibbo\Foursquare\Client\Configuration;
use Gibbo\Foursquare\Client\Entity\Coordinates;
use Gibbo\Foursquare\Client\Factory\Venue\VenueFactory;
use Gibbo\Foursquare\Client\Identifier;
use Gibbo\Foursquare\Client\Options\Search;

$client = Client::simple(new Configuration('client-id', 'client-secret'), VenueFactory::simple());

// Get by id
$venue = $client->getVenue(new Identifier('430d0a00f964a5203e271fe3'));

$venue->getName();
$venue->getDetails()->getRating();

// Search by coordinates
$options = Search::coordinates(new Coordinates(28.538336, -81.379234))
    ->limit(10)
    ->radius(500)
    ->query('Donuts');

$venues = $client->search($options);

// Search by place
$options = Search::place('Chicago, IL')
    ->limit(10)
    ->radius(500)
    ->query('Donuts');

$venues = $client->search($options);

变更日志

有关最近更改的详细信息,请参阅 CHANGELOG

测试

$ composer test

贡献

有关详细信息,请参阅 CONTRIBUTING

安全性

如果您发现任何安全问题,请通过电子邮件 ben.gibson.2011@gmail.com 而不是使用问题跟踪器。

鸣谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件