Code Monkey home page Code Monkey logo

jvimeo's Introduction

JVimeo

A jQuery plugin to get information about public videos, users, groups, channels, albums, and activity from the Vimeo API. Visit www.deskode.com

Dependencies

For normal usage; jQuery 1.3 or higher.

Usage

JVimeo makes available methods for retrieving video and user information from the Vimeo.com API. All the available methods are accessed from the JVimeo object which is a member of the jQuery or $ object.

Get User data

$.jvimeo.request(username, callback)

Parameters

  • request ("getUserInfo").

  • username or id string/int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

Requests you can make

getUserInfo User info for the specified user
getUserVideos Videos created by user
getUserLikes Videos the user likes
getUserAppearsIn Videos that the user appears in
getUserAllVideos Videos that the user appears in and created
getUserSubscriptions Videos the user is subscribed to
getUserAlbums Albums the user has created
getUserChannels Channels the user has created and subscribed to
getUserGroups Groups the user has created and joined

Example

$.jvimeo.getUserInfo("IvanSotelo", function(data){
    var html = [];

    html.push('<a href="' + profile_url + '"><img src="' +  portrait_large + '" alt=""></a>');
    html.push('<div><h3>' + display_name + '</h3>');
    html.push('<h4><a href="' + profile_url + '">' + profile_url + '</a></h4>');
    html.push('<ul><li><b>Videos: </b>' + total_videos_uploaded + '</li>');
    html.push('<li><b>Contacts: </b>' +  total_contacts + '</li>');
    html.push('<li><b>Channels: </b>' + total_channels + '</li>');
    html.push('<li><b>Likes: </b>' +  total_videos_liked + '</li></ul></div>');

    $('#userInfo').html(html.join(''));
                });    

Get a Video data

$.jvimeo.getVideo(video_id, callback)

Parameters

  • video_id int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

$.jvimeo.getVideo(161803, function(data){
    var html = [];

    $('#videoById a:first').attr('href', data.url);
    $('#videoById img').attr('src', data.thumbnail_large);
    $('#videoById h3').text(data.title);
    $('#videoById h4').html('by <a href="' + data.user_url + '">' + data.user_name + '</a>');

    html.push('<li><b>Views:</b> ' + data.stats_number_of_views + '</li>');
    html.push('<li><b>Likes:</b> ' + data.stats_number_of_likes + '</li>');
    html.push('<li><b>Comments:</b> ' + data.stats_number_of_comments + '</li>');

    $('#videoById ul').html(html.join(''));
                });    

Get Activity data

$.jvimeo.request(username, callback)

Parameters

  • request ("getActivityByUser").

  • username or id string/int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

Requests you can make

getActivityByUser Activity by the user
getActivityOnUser Activity on the user
getActivityByContacts Activity by the user’s contacts
getActivityEveryone Activity by everyone

Example

$.jvimeo.getActivityByUser("IvanSotelo", function(data){
    var html = [];

    html.push('<a href="' + profi le_url + '"><img src="' +  portrait_large + '" alt=""></a>');
    html.push('<div><h3>' + display_name + '</h3>');
    html.push('<h4><a href="' + profile_url + '">' + profile_url + '</a></h4>');
    html.push('<ul><li><b>Videos: </b>' + total_videos_uploaded + '</li>');
    html.push('<li><b>Contacts: </b>' +  total_contacts + '</li>');
    html.push('<li><b>Channels: </b>' + total_channels + '</li>');
    html.push('<li><b>Likes: </b>' +  total_videos_liked + '</li></ul></div>');

    $('#userInfo').html(html.join(''));
                });    

Get Group data

$.jvimeo.request(groupname, callback)

Parameters

  • request ("getActivityByUser").

  • groupname url or id string/int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

Requests you can make

getGroupVideos Videos added to that group
getGroupUsers Users who have joined the group
getGroupInfo Group info for the specified group

Example

 $.jvimeo.getGroupVideos("2279524", function(data){
    var html = [];

    $.each(data, function (i, data) {
        html.push('<li>');
        html.push('<div class="details"><h3>' + data.title + '</h3>');
        html.push('<h4>by <a href="' + data.user_url + '">' + data.user_name + '</a></h4></div>');
        html.push('<a href="' + data.url + '" target="_blank" class="linkc">');
        html.push('<img src="' + data.thumbnail_large + '" alt="' + data.title + '">');
        html.push('</a></li>');
    });
    
    $('#shotsListing').html(html.join(''));
                });     

Get Channel data

$.jvimeo.request(channelname, callback)

Parameters

  • request ("getChannelVideos").

  • channelname url or id string/int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

Requests you can make

getChannelVideos Videos in the channel
getChannelInfo Channel info for the specified channel

Example

 $.jvimeo.getChannelVideos("2279524", function(data){
    var html = [];

    $.each(data, function (i, data) {
        html.push('<li>');
        html.push('<div class="details"><h3>' + data.title + '</h3>');
        html.push('<h4>by <a href="' + data.user_url + '">' + data.user_name + '</a></h4></div>');
        html.push('<a href="' + data.url + '" target="_blank" class="linkc">');
        html.push('<img src="' + data.thumbnail_large + '" alt="' + data.title + '">');
        html.push('</a></li>');
    });
    
    $('#videos').html(html.join(''));
                });     

Get Album data

$.jvimeo.request(Albumname, callback)

Parameters

  • request ("getChannelVideos").

  • Albumname url or id string/int.

  • callback FUNC Function to call once the request has completed successfully. One parameter will be passed containing the JSON response of the request; callback(data).

Requests you can make

getAlbumVideos Videos in that album
getAlbumInfo Album info for the specified album

Example

 $.jvimeo.getAlbumVideos("2279524", function(data){
    var html = [];

    $.each(data, function (i, data) {
        html.push('<li>');
        html.push('<div class="details"><h3>' + data.title + '</h3>');
        html.push('<h4>by <a href="' + data.user_url + '">' + data.user_name + '</a></h4></div>');
        html.push('<a href="' + data.url + '" target="_blank" class="linkc">');
        html.push('<img src="' + data.thumbnail_large + '" alt="' + data.title + '">');
        html.push('</a></li>');
    });
    
    $('#videos').html(html.join(''));
                });     

Response Data.

There are a few different types of responses.

Video data

duration
title Video title
url URL to the Video Page
id Video ID
description The description of the video
thumbnail_small URL to a small version of the thumbnail
thumbnail_medium URL to a medium version of the thumbnail
thumbnail_large URL to a large version of the thumbnail
user_name The user name of the video’s uploader
user_url The URL to the user profile
upload_date The date/time the video was uploaded on
user_portrait_small Small user portrait (30px)
user_portrait_medium Medium user portrait (100px)
user_portrait_large Large user portrait (300px)
stats_number_of_likes # of likes
stats_number_of_views # of views
stats_number_of_comments # of comments
Duration of the video in seconds
width Standard definition width of the video
height Standard definition height of the video
tags Comma separated list of tags

User info data

id User ID
display_name User name
created_on Date the user signed up
is_staff Is this user a staff member?
is_plus Is this user a Vimeo Plus member?
location The location of the user
url User supplied url
bio The bio information from the user profile
profile_url URL to the user profile
videos_url URL to the video list for this user
total_videos_uploaded Total # of videos uploaded
total_videos_appears_in Total # of videos user appears in
total_videos_liked Total # of videos liked by user
total_contacts Total # of contacts
total_albums Total # of albums
total_channels Total # of channels moderated by user
portrait_small Small user portrait (30px)
portrait_medium Medium user portrait (100px)
portrait_large Large user portrait (300px)

Group info data

id Group ID
name Group name
description Group description
url URL for the group page
logo Group logo (header)
thumbnail Thumbnail
created_on Date the group was created
creator_id User ID of the group creator
creator_display_name Name of the User who created the group
creator_url The URL to the group creator’s profile
total_members Total # of users joined
total_videos Total # of videos posted to the group
total_files Total # of files uploaded to the group
total_forum_topics Total # of forum topics
total_events Total # of events
total_upcoming_events Total # of upcoming events

Channel info data

id Channel ID
name Channel name
description Channel description
logo Channel logo (header)
url URL for the channel page
rss RSS feed for the channel’s videos
created_on Date the channel was created
creator_id User ID of the channel creator
creator_display_name Name of the User who created the channel
creator_url The URL to the channel creator’s profile
total_videos Total # of videos posted in the channel
total_subscribers Total # of users subscribed

Album info data

id Album ID
created_on Date the album was created
last_modified Date the album was last modified
title Album title
description Album description
url URL for the album page
thumbnail Thumbnail
total_videos Total # of videos added to the album
user_id User ID of the user who made the album
user_display_name Name of the User who created the album
user_url The URL to the album creator’s profile

jvimeo's People

Contributors

ivansotelo avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

adrianmora1

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.