diff --git a/examples/buzz.rb b/examples/buzz.rb new file mode 100644 index 000000000..4e1dabf08 --- /dev/null +++ b/examples/buzz.rb @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +# RUN +# ruby examples/buzz.rb + +root_dir = File.expand_path("../../..", __FILE__) +lib_dir = File.expand_path("./lib", root_dir) + +$LOAD_PATH.unshift(lib_dir) +$LOAD_PATH.uniq! + +require 'rubygems' +begin + require 'signet/oauth_1/client' + require 'google/api_client' +rescue LoadError + STDERR.puts "Missing dependencies." + STDERR.puts "sudo gem install signet google-api-client" + exit(1) +end + +client = Google::APIClient.new(:service => 'buzz') +response = client.execute( + 'chili.activities.list', + 'userId' => 'googlebuzz', 'scope' => '@public', 'alt' => 'json', 'pp' => '1' +) +status, headers, body = response +puts body +exit(0) diff --git a/examples/sinatra/explorer.rb b/examples/sinatra/explorer.rb index cf98bdda8..c1f03d94d 100644 --- a/examples/sinatra/explorer.rb +++ b/examples/sinatra/explorer.rb @@ -1,9 +1,8 @@ #!/usr/bin/env ruby -# INSTALL -# sudo gem install sinatra liquid # RUN -# ruby examples/sinatra/buzz_api.rb +# ruby examples/sinatra/explorer.rb +# navigate a browser to http://localhost:4567/explore/buzz-v1/ root_dir = File.expand_path("../../..", __FILE__) lib_dir = File.expand_path("./lib", root_dir)