Git Product home page Git Product logo

wistia-api's Introduction

DEPRECATED

This gem is no longer actively supported or maintained. The best course of action is to manage your own HTTP calls to Wistia rather than rely on our client library.

Wistia API Gem

Ruby wrapper for the Wistia Data API.

Useful as a wrapper for the Wistia::Media, Wistia::Project, Wistia::Projects::Sharing, and Wistia::Stats classes.

See http://wistia.com/doc/data-api for more info.

Required gems:

  • activeresource >= 2.3.8

Install:

gem install wistia-api

Basic Usage

Start by requiring Wistia and configuring your API password:

require 'wistia'
Wistia.password = 'your-api-password-here'

Configuration Options

Set the format of the API:

Wistia.format = 'json'  # This is the default.
Wistia.format = 'xml'

Read configuration from an external YAML file:

Wistia.use_config!(path_to_yaml)

For an example YAML config, see spec/support/config.test.yml

Configure using a Hash:

Wistia.use_config!(:wistia => {
  :api => {
    :password => 'your-api-password',
    :format => 'xml-or-json'
  }
})

Examples

List all Media in your account:

Wistia::Media.find(:all)

List all Projects in your account:

Wistia::Project.find(:all)

List all Sharing objects for a project:

Wistia::Projects::Sharing.find(:all, params: { project_id: 'YOUR_PROJECT_ID' })

Get stats for a project since December 1, 2012

Wistia::Stats::Project.get('YOUR_PROJECT_ID/by_date', start_date: '2012-12-01')

List Overall Stats for Your Account

Wistia::Stats::Account.find_singleton

Find Media based on media id in your account:

media = Wistia::Media.find('YOUR_MEDIA_ID')

so you can access all attributes of media through media object.

media.name # => 'video name'

also you can update media attributes through this object.

media.name = 'new video name'
media.save  # => true

Find Project based on project id in your account:

project = Wistia::Project.find('YOUR_PROJECT_ID')

so you can access all attributes of project through project object.

project.name # => 'project name'

also you can update project attributes through this object.

project.name = 'new project name'
project.save # => true

Copyright

Copyright (c) 2011 Wistia, Inc. See LICENSE.txt for further details.

wistia-api's People

Contributors

anantkolvankar avatar bschwartz avatar freerobby avatar javilongboat avatar jeffvincent avatar joshuapinter avatar jrgifford avatar lpommers avatar

Watchers

 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.