nfm / gplus Goto Github PK
View Code? Open in Web Editor NEWA complete implementation of the Google+ API for Ruby
A complete implementation of the Google+ API for Ruby
We're try to use gplus, but after a successfull oauth process, the normal api requests are not working:
Gplus Client: #<Gplus::Client:0x6aa9780 @oauth_client=#<OAuth2::Client:0x6aa95c8 @site="https://www.googleapis.com/plus", @id="XXX", @secret="XXX", @options={:token_method=>:post, :connection_opts=>{}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>true, :authorize_url=>"https://accounts.google.com/o/oauth2/auth", :token_url=>"https://accounts.google.com/o/oauth2/token"}>, @token_expires_at=1325083620, @token="XXX, @redirect_uri="XXX", @refresh_token="XXX", @client_secret="XXX", @client_id="XXX", @api_version="v1", @endpoint="https://www.googleapis.com/plus", @api_key=nil>
Gplus access token: MISSING!
Oauth error: #<OAuth2::Error: OAuth2::Error>
Oauth response: #<OAuth2::Response:0x6a97a58 @error=#<OAuth2::Error: OAuth2::Error>, @parsed={"error"=>{"code"=>400, "errors"=>[{"domain"=>"global", "reason"=>"badRequest", "message"=>"Bad Request"}], "message"=>"Bad Request"}}, @response=#<Faraday::Response:0x6a97a80 @env={:response=>#<Faraday::Response:0x6a97a80 ...>, :response_headers=>{"x-content-type-options"=>"nosniff", "x-frame-options"=>"SAMEORIGIN", "expires"=>"Wed, 28 Dec 2011 14:09:57 GMT", "content-type"=>"application/json; charset=UTF-8", "connection"=>"close", "date"=>"Wed, 28 Dec 2011 14:09:57 GMT", "x-xss-protection"=>"1; mode=block", "server"=>"GSE", "cache-control"=>"private, max-age=0"}, :request_headers=>{}, :status=>400, :request=>{:proxy=>nil}, :method=>:get, :parallel_manager=>nil, :url=>#<Addressable::URI:0x355221c URI:https://www.googleapis.com/plus/v1/people/115135253293279523949?key=>, :ssl=>{}, :body=>"{\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "badRequest",\n "message": "Bad Request"\n }\n ],\n "code": 400,\n "message": "Bad Request"\n }\n}\n"}, @on_complete_callbacks=[]>, @options={:parse=>nil}>
May be the API has changed?
Thanks,
Tamas
Hey can someone tell me how can I get people's email using this gem, somewhat the response is not returning email.
OAuth2 only raises OAuth2::Error
exceptions. While this is the correct behavior (it's a general purpose tool and shouldn't have to know anything about specific Google+ errors), it makes debugging a real pain in Gplus.
Gplus needs to raise sensible, Google+ specific exceptions, including the error messages returned from Google+.
@tompata, you mentioned in #1 that "debugging is very difficult now". How are you currently debugging Gplus, and is it more difficult in 2.0.0? Would Gplus raising specific exceptions (instead of not catching OAuth2::Error
s) be helpful?
in the gem data.tar.gz, where all the (lib) files are located, there's wrong file permissions.
there's only RW permissions for the owner, but all the other read permissions are missing! (0600)
that's why in our server the gplus gem is unavailable: uninitialized constant Gplus
the expected, correct file permissions would be:
0644
please modify the file permissions before build the next gem version!
thanks,
Tamas
An activity carries the count for comments, pluses and reshares, but all of those also provide a URI to fetch the actual comments or reshares. The gem currently provides a way to fetch comments, but nothing for plusoners / resharers -- would be great to have!
When the token expires, gplus should refresh the token automatically.
But actually I've got the following oauth error:
Oauth error: # Oauth response: #, @parsed={"error"=>{"code"=>401, "errors"=>[{"location"=>"Authorization", "domain"=>"global", "locationType"=>"header", "reason"=>"authError", "message"=>"Invalid Credentials"}], "message"=>"Invalid Credentials"}}, @response=##, :status=>401, :request=>{:proxy=>nil}, :parallel_manager=>nil, :method=>:get, :response_headers=>{"x-content-type-options"=>"nosniff", "x-frame-options"=>"SAMEORIGIN", "expires"=>"Tue, 03 Jan 2012 13:48:19 GMT", "content-type"=>"application/json; charset=UTF-8", "connection"=>"close", "www-authenticate"=>"AuthSub realm=\"https://www.google.com/accounts/AuthSubRequest\" allowed-scopes=\"https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/plus.me,https://www.googleapis.com/auth/plus.people.recommended\"", "date"=>"Tue, 03 Jan 2012 13:48:19 GMT", "x-xss-protection"=>"1; mode=block", "server"=>"GSE", "cache-control"=>"private, max-age=0"}, :url=>#, :request_headers=>{"Authorization"=>"Bearer ya29.AHES6ZQZV22ZSbd23he23pcufyUifj0kE_FecvCJAel-1vixl_kduw"}, :ssl=>{}, :body=>"{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"authError\",\n \"message\": \"Invalid Credentials\",\n \"locationType\": \"header\",\n \"location\": \"Authorization\"\n }\n ],\n \"code\": 401,\n \"message\": \"Invalid Credentials\"\n }\n}\n"}, @on_complete_callbacks=[]>, @options={:parse=>nil}>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.