Skip to content

Instantly share code, notes, and snippets.

@benwells
Created March 11, 2014 19:29
Show Gist options
  • Save benwells/9493247 to your computer and use it in GitHub Desktop.
Save benwells/9493247 to your computer and use it in GitHub Desktop.
blah
require 'sinatra'
require 'vimeo'
require 'shotgun'
require 'haml'
enable :sessions
set :protection, :except => :frame_options
get '/:key/:secret/:access_token/:access_token_secret/:user_id' do
session['ck'] = params[:key];
session['cs'] = params[:secret];
session['at'] = params[:access_token];
session['ats'] = params[:access_token_secret];
session['uid'] = params[:user_id];
# base = Vimeo::Advanced::Base.new(consumer_key, consumer_secret, :token => access_token, :secret => access_token_secret)
# puts base.user_id
redirect '/list/1';
end
get '/list/:page' do
# getting and listing videos
video = Vimeo::Advanced::Video.new(session['ck'],
session['cs'],
:token => session['at'],
:secret => session['ats']);
@videos = video.get_all(session['uid'], {
:page => params[:page],
:per_page => "5",
:full_response => "1",
:sort => "newest"
});
@videos = @videos['videos']['video']
haml :index
end
get '/view/:id' do
@videoId = params[:id];
haml :view;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment