rfreebern/giphy-php 问题修复 & 功能扩展

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

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

rfreebern/giphy-php

Composer 安装命令:

composer require rfreebern/giphy-php

包简介

A library implementing access to the Giphy API.

README 文档

README

A library providing a PHP interface to the Giphy API.

Installation

composer require rfreebern/giphy-php 

Example

There is a file named giphy in the bin directory. Use it like this:

$ ./bin/giphy whiskey 

GIF Usage

$giphy = new \rfreebern\Giphy(); $result = $giphy->random('whiskey'); print $result->data->image_original_url; 

By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:

$giphy = new \rfreebern\Giphy($my_giphy_api_key); 

In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments.

search($query, $limit = 25, $offset = 0)

Searches for gifs matching $query.

getByID($id)

Fetches a specific GIF by its Giphy ID.

getByIDs(array $ids)

Fetches one or more specific GIFs by their Giphy IDs.

translate($query)

Translates a query to a matching GIF. See the docs for more information.

random($tag = null)

Fetches a random GIF, optionally matching the given tag.

trending($limit = 25)

Fetches a list of trending GIFs.

Sticker Usage

$sticker = new \rfreebern\Sticker(); $result = $sticker->random('whiskey'); print $result->data->image_original_url; 

By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:

$giphy = new \rfreebern\Giphy($my_giphy_api_key); 

In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments.

search($query, $limit = 25, $offset = 0)

Searches for stickers matching $query.

translate($query)

Translates a query to a matching sticker. See the docs for more information.

random($tag = null)

Fetches a random sticker, optionally matching the given tag.

trending($limit = 25)

Fetches a list of trending stickers.

Credits

  • This library was created by Ryan Freebern / @rfreebern.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: CC0-1.0
  • 更新时间: 2026-01-04