GithubHelp home page GithubHelp logo

agilie / vimeo-api-gem Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 6.0 57 KB

A Ruby wrapper for the Vimeo API. Utilizes v3 API version

License: MIT License

Ruby 99.17% Shell 0.83%
ruby ruby-on-rails api-client vimeo vimeo-api ruby-gem

vimeo-api-gem's Introduction

Vimeo API Client

Vimeo API Client

A Ruby wrapper for the Vimeo API. It utilizes v3 Vimeo API version. For more detailed documentation please refer to the Wiki and official Vimeo documentation

Installation

Add this line to your application's Gemfile:

gem 'vimeo_api_client', git: 'https://github.com/agilie/vimeo-api-gem'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vimeo_api_client

Example

Usage

Universal API call

As long as not all the API endpoints are implemented in "Ruby Way" you can make any request with a universal wrapper i.e

Vimeo.resource.get('/api/resource/id/etc')

Available actions are get, post, put, patch and delete

For example

# Get all videos a user has liked
Vimeo.resource.get('/me/likes')

# Add video to an album
Vimeo.resource.put("/me/albums/#{album_id}/videos/#{video_id}")

# Delete a channel
Vimeo.resource.delete("/channels/#{channel_id}")

Working with resources

See more details on Wiki

Vimeo API workflow is based on a different resources such as users, videos, albums, comments etc. Each resource has its own uri and methods. Almost all of them has standard Create Read Update Destroy actions.

You can build a resource on the basis of its uri and call appropriate action:

# Get all albums of user with ID 12345
Vimeo.album('/users/12345/albums').index

# Delete my album with ID 67890
Vimeo.album('/me/albums/67890').destroy

Resource may have some specific actions, i.e.

# Add videos to my album
Vimeo.album('/me/albums/67890').add_videos(['11111', '22222', '33333'])

As you can see the resources are nested. For example, user can have many albums, video can have many comments and so on. Using this, you can rewrite actions above in more natural way:

# Get all albums of user with ID 12345
Vimeo.user('12345').albums.index

# Delete my album with ID 67890
Vimeo.user.album('67890').destroy

# Add videos to my album
Vimeo.user.album('67890').add_videos(['11111', '22222', '33333'])

Author

This gem is open-sourced by Agilie Team ([email protected])

Contributor

Sergey Mell

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/agilie/vimeo-api-gem. This project is intended to be a safe, welcoming space for collaboration and contributors.

Contact us

If you have any questions, suggestions or just need a help with web or mobile development, please email us at [email protected]. You can ask us anything from basic to complex questions.

We will continue publishing new open-source projects. Stay with us, more updates will follow!

License

The gem is available as open source under the MIT License (MIT) Copyright © 2017 Agilie Team

vimeo-api-gem's People

Contributors

sergeymell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.