lib-giphy
Version, currently 0.7.07 versions
github.com/henrikac/lib-giphy
Crystal library that makes it easy to interact with the GIPHY API
6 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
lib-giphy:
github: henrikac/lib-giphy
version: ~> 0.7.0Then run:
shards installshard.yml
- Crystal
1.0.0- License
- MIT
- Author
- Henrik Christensen <sensen1695@hotmail.com>
Dependencies
Development Dependencies
README
# lib-giphy
A library that makes it easy to interact with the [GIPHY API](https://developers.giphy.com/).
## Requirements
To get the API key that is required to create a new `Giphy::Client` you need to create a GIPHY app.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
lib-giphy:
github: henrikac/lib-giphy
```
2. Run `shards install`
## Usage
```crystal
require "lib-giphy"
giphy = Giphy::Client.new <api_key>
gifs = giphy.search("cats") # => returns 25 gifs
trend_gifs = giphy.trending() # => returns 25 gifs
translated = giphy.translate("cats") # => returns 1 gif
random_gif = giphy.random() # => returns 1 gif
gifs.data.each do |gif|
puts gif.title
end
```
The `Giphy::Client` methods in the example above can also take a `Param` object as a second argument.
Different types of `Param`:
* `SearchParam`
* `TrendingParam`
* `TranslateParam`
* `RandomParam`
## Supported endpoints
* [X] Trending
* [X] Search
* [X] Translate
* [X] Random
* [ ] Action Register
* [X] Random ID
* [X] Get GIF by ID
* [X] Get GIFs by ID
* [ ] Upload
* [X] Categories
* [ ] Autocomplete
* [ ] Channel Search
* [ ] Search Suggestions
* [ ] Trending Search Terms
## Contributing
1. Fork it (<https://github.com/henrikac/lib-giphy/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Henrik Christensen](https://github.com/henrikac) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.7.0- Tagged
- Apr 29, 2021
- Commit
78aa974bb3d1- Crystal
1.0.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/henrikac/lib-giphy
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 7