Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created January 31, 2010 12:49
Show Gist options
  • Select an option

  • Save ukstudio/291049 to your computer and use it in GitHub Desktop.

Select an option

Save ukstudio/291049 to your computer and use it in GitHub Desktop.
# /opensocial-0.0.4/lib/opensocial/auth/action_controller_request.rb
module OAuth::RequestProxy #:nodoc: all
class ActionControllerRequest < OAuth::RequestProxy::Base
#proxies ActionController::AbstractRequest
proxies(defined?(ActionController::AbstractRequest) ? ActionController::AbstractRequest : ActionController::Request)
# coding: utf-8
require 'rubygems'
require 'oauth'
require 'opensocial'
CONSUMER_KEY = 'CONSUMER_KEY'
CONSUMER_SECRET = 'CONSUMER_SECRET'
requester_id = 'mixi id'
module OpenSocial
class Connection
MIXI = { :endpoint => 'http://api.mixi-platform.com/os/0.8/people/',
:rest => '',
:rpc => '',
:content_type => 'application/json',
:post_body_signing => false,
:use_request_body_hash => true }
end
end
con = OpenSocial::Connection.new(
:container => OpenSocial::Connection::MIXI,
:consumer_key => CONSUMER_KEY,
:consumer_secret => CONSUMER_SECRET,
:xoauth_requestor_id => requester_id
)
req = OpenSocial::FetchPersonRequest.new(con)
puts req.send.inspect
req = OpenSocial::FetchPeopleRequest.new(con)
puts req.send.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment