This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WebEx | |
## Convenience methods | |
def self.filter_by_session_name(collection, name=nil) | |
return collection unless name | |
collection.collect{|session| | |
session if session['sessionName'].downcase.include?(name) | |
}.compact | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Provides a list of attendees based on meeting ID | |
get '/list-attendees/:meeting_id' do | |
w = WebEx::Request.new | |
attendees = w.lst_meeting_attendee(params[:meeting_id]) | |
if attendees[:response][:result] == "SUCCESS" | |
@attendees = attendees[:body] | |
erb :list_attendees, :layout => false | |
else | |
LOGGER.warn('Problem obtaining meeting information') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Booting ---- | |
$: << File.join(File.dirname(__FILE__), 'lib') | |
$: << File.join(File.dirname(__FILE__), 'routes') | |
$: << File.join(File.dirname(__FILE__), 'helpers') | |
SINATRA_ROOT = File.expand_path(File.dirname((__FILE__))) unless defined? SINATRA_ROOT | |
require "rubygems" | |
require "sinatra" | |
require 'config/config' | |
# /Booting ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZPROXY_CONFIG = Hash.new | |
# General config | |
configure do | |
gems = %w(activerecord logger hpricot open-uri resolv restclient net/http yaml rexml/document rack-flash mailfactory json net/smtp) | |
zproxy_libs = %w(submission validator webex) | |
(gems + zproxy_libs).each do |dependency| | |
begin | |
require dependency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: << File.join(File.dirname(__FILE__), '..') | |
begin | |
require "spec" | |
require "spec/interop/test" | |
require 'rack/test' | |
require "proxy" | |
require "libxml" | |
Test::Unit::TestCase.send :include, Rack::Test | |
rescue LoadError => error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------- POST handler -- processes the form submission ----------------------- | |
post "/post" do | |
# Instantiate the Submission to get the party started | |
sub = Submission.new(params, | |
request.env['HTTP_REFERER'], | |
request.env['REMOTE_ADDR'] | |
) | |
debugger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require "rubygems" | |
require "hpricot" | |
# File to alter and suffix to add | |
HEADER_FILE = "/path/to/your/file" | |
suffix = "?time=" + Time.now.strftime('%Y%m%d%H%M%S') | |
# Use Hpricot to open and parse file as well as to find path |
NewerOlder