giphy / giphy-php-client
1.0.0
2017-09-27 21:06 UTC
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ~4.8
- satooshi/php-coveralls: ~1.0
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2024-09-18 22:15:57 UTC
README
Giphy 核心SDK 是 Giphy API 的封装。
Giphy 是在互联网上搜索、分享和发现GIF的最佳方式。类似于其他搜索引擎的工作方式,我们的大部分内容来自对网络上最好和最受欢迎的GIF和搜索词的索引。我们组织了所有这些GIF,以便您可以更容易地找到优质内容并通过您的社交渠道分享它。我们还介绍了一些我们最喜欢的GIF艺术家,并与品牌合作创建和推广他们原创的GIF内容。
入门
要求
PHP 5.4.0 及以上版本
安装与使用
安装
composer require giphy/giphy-php-client
使用
require_once('/path/to/GiphyClient/autoload.php');
入门
请遵循安装流程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new GPH\Api\DefaultApi(); $api_key = "dc6zaTOxFJmzC"; // string | Giphy API Key. $q = "cheeseburgers"; // string | Search query term or prhase. $limit = 25; // int | The maximum number of records to return. $offset = 0; // int | An optional results offset. Defaults to 0. $rating = "g"; // string | Filters results by specified rating. $lang = "en"; // string | Specify default country for regional content; use a 2-letter ISO 639-1 country code. See list of supported languages <a href = \"../language-support\">here</a>. $fmt = "json"; // string | Used to indicate the expected response format. Default is Json. try { $result = $api_instance->gifsSearchGet($api_key, $q, $limit, $offset, $rating, $lang, $fmt); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->gifsSearchGet: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI相对于 http://api.giphy.com/v1
模型文档
- BaseChannelModel
- BaseChannelModelGifs
- Breadcrumb
- Category
- ChannelWithChildrenModel
- ChannelWithChildrenModelChildren
- Gif
- GifImages
- GifImagesDownsized
- GifImagesDownsizedLarge
- GifImagesDownsizedMedium
- GifImagesDownsizedSmall
- GifImagesDownsizedStill
- GifImagesFixedHeight
- GifImagesFixedHeightDownsampled
- GifImagesFixedHeightSmall
- GifImagesFixedHeightSmallStill
- GifImagesFixedHeightStill
- GifImagesFixedWidth
- GifImagesFixedWidthDownsampled
- GifImagesFixedWidthSmall
- GifImagesFixedWidthSmallStill
- GifImagesFixedWidthStill
- GifImagesLooping
- GifImagesOriginal
- GifImagesOriginalStill
- GifImagesPreview
- GifImagesPreviewGif
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse400
- LastChildModel
- LastChildModelChildren
- MetaContent
- MetaObject
- Pagination
- RandomGif
- ShallowTag
- Tag
- TrendingTag
- User