Git Product home page Git Product logo

giphy's Introduction

Giphy

Build Status Code Climate

Because GIFs make life fun! Use Giphy API from your Ruby programs and command line. Check out Giphy Labs for inspiration.

Installation

Add this line to your application's Gemfile:

gem 'giphy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install giphy

Usage

Set the API version and api_key:

Giphy::Configuration.configure do |config|
  config.version = THE_API_VERSION
  config.api_key = YOUR_API_KEY
end

Important: Giphy API is currently in public beta. Unless version and api_key are set to specific values the default values for the beta period will be used. Check Giphy's API for updates.

That's it, you're ready to have fun!

Recent

Giphy.recent(tag: 'cats', limit: 5)

Translate

Giphy.translate('geek')

Search

Giphy.search('funny cat', {limit: 50, offset: 25})

Flagged

Write

Giphy.flag('m5QHf0caAwgMw')

Read

Giphy.flagged

Favorites

Write

Giphy.favorite('12HoHdqnDxz5NS')

Read

Giphy.favorites('absurdnoise', {limit: 50, offset: 25})

Screensaver

Giphy.screensaver('surprise')

Random

Giphy.random

For getting random gifs with a specific tag:

Giphy.random('american psycho')

Artists

Giphy.artists

GIFs by artist

Giphy.gif_by_artist('89a', {limit: 5, offset: 10})

GIFs by ID

Giphy.gif_by_id('feqkVgjJpYtjy', '12HoHdqnDxz5NS', '7rzbxdu0ZEXLy')

Command Line Tool

There is a small command line tool that let's you search for GIFs from the command line and opens it on your browser. Just for fun.

$ giphy 'dance'

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 1.9
  • Ruby 2.0
  • Ruby 2.1

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Run tests: rake
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Create new Pull Request

License

See LICENSE for details.

giphy's People

Contributors

sogamoso avatar neanias avatar caseywatts avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.