补充:空气糟糕,食物差...
北京又悲催的漂过,房价高,消费高,消费体验嘛,咳.....
悲催的北京...
帮你顶一下,说一下你们正在做的事吧 或者贴个网址
怎么回事 删掉一条回复了?
#5 楼 @hlcfan 用 'omniauth-oauth2'
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2
# Give your strategy a name.
option :name, "weibo"
# This is where you pass the options you would pass when
# initializing your consumer from the OAuth gem.
option :client_options, {
:site => 'https://api.weibo.com',
:authorize_url => '/oauth2/authorize',
:token_url => '/oauth2/access_token'
}
option :token_params, {
# SET :parse because weibo oauth2 access_token response with "content-type"=>"text/plain;charset=UTF-8",
# and when you use ruby 1.8.7, the response body was not a valid HASH (see: https://github.com/intridea/oauth2/issues/75)
# :body=>"{\"access_token\":\"2.001FOK5CacB2wCc20a59773d0uSGnj\",\"expires_in\":86400,\"uid\":\"2189335154\"}"}
:parse => :json
}
# These are called after authentication has succeeded. If
# possible, you should try to set the UID without making
# additional calls (if the user id is returned with the token
# or as a URI parameter). This may not be possible with all
# providers.
uid { raw_info['id'] }
info do
{
:nickname => raw_info['screen_name'],
:name => raw_info['name'],
:location => raw_info['location'],
:avatar_url => raw_info['avatar_large']
}
end
extra do
{
'raw_info' => raw_info
}
end
def raw_info
# SET :mode because by default it will use :header option, and send out header like
# opts[:headers]={"Authorization"=>"Bearer 2.001FOK5CacB2wCc20a59773d0uSGnj"}
# this doesn't align with weibo API (see: http://open.weibo.com/wiki/2/account/get_uid)
access_token.options[:mode] = :query
access_token.options[:param_name] = 'access_token'
@uid ||= access_token.get('/2/account/get_uid.json').parsed["uid"]
@raw_info ||= access_token.get("/2/users/show.json", :params => {:uid => @uid}).parsed
end
end
end
end
initializers 中 omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
require 'weibo'
provider :weibo, Setting.weibo_key, Setting.weibo_secret
end
还是看需要吧,你想要不一样的风格时就自己写
好诱人啊~~
毕业后就没用过了
感觉很山寨。
把服务器放在国外就不用备案了~
真是悲剧 刚才 ping 了一下 500 多了~
#48 楼 @alucardpj 应该是定时取的,或者是在队列里,不是即时更新的,我猜的
#47 楼 @liluo #41 楼 @alucardpj 刚才去他们那个在线聊天室聊了聊,这种情况挺多的,给这个账号 发邮件 [email protected], 然后只能等着了...
#39 楼 @alucardpj 我也是,收到这么一个邮件
* linode213296 - (8080605) Linode Initial Configuration - Completed Tue, 19 Jun 2012 16:33:17 GMT
This is a new feature. You can change your notification settings via https://manager.linode.com/profile.
看来他们也在解决,唉,只能等了
#25 楼 @qichunren 刚才支付了一下,钱被扣了,但是注册失败,登录显示账号微验证,邮箱也没有邮件...难道又悲剧了?