Tag: yahoo api

带有Ruby on Rails和OAUTH2的Yahoo API

我有一个从证券交易所获取数据的RoR网站,我通过Yahoo API使用Yahoo的财务表。 我需要授权才能获得对YQL的完全访问权限,这需要我使用Oauth2。 我需要帮助OAuth访问Yahoo。 这是我尝试过的: client = OAuth2::Client.new(oauth_consumer_key,oauth_consumer_secret, { access_token_path: ‘/oauth/v2/get_token’, authorize_path: ‘/oauth/v2/request_auth’, authorize_url: ‘https://api.login.yahoo.com/oauth/v2/request_auth’, request_token_path: ‘/oauth/v2/get_request_token’, site: ‘https://api.login.yahoo.com’ }) puts client.auth_code.authorize_url( redirect_uri: “http://localhost:3000”) code = gets.chomp token = client.auth_code.get_token(code, redirect_uri: “http://localhost:3000”) 我不知道我必须使用哪个“代码”。 Authorize_url返回给我这个URL ,但不清楚“代码”是什么。 我受到了这个问题的启发。

我的雅虎联系人导入OmniContacts gem总是失败

我正在使用OmniContacts gem将联系人从yahoo和gmail导入我的应用程序。 现在雅虎import商停止工作了。 我的控制器上有以下操作: def contacts_callback @contacts = request.env[‘omnicontacts.contacts’] @importer = params[:importer] if session[:draw_token] @draw_token = session[:draw_token] end end def import_failed if session[:draw_token] draw = Draw.find_by_token(session[:draw_token]) if draw != nil session[:draw_token] = nil redirect_to dashboard_draw_url(draw) else session[:draw_token] = nil redirect_to root_path, alert: _(‘Draw not exists.’) end else redirect_to dashboard_show_invitation_email_friendship_url, alert: _(‘You have canceled the request.’) […]