2013-08-06 1 views
0

Twitter의 새로운 1.1 API를 지원하려면 twitter_oauth 보석을 v.0.4.9로 업데이트해야했습니다. 그러나 즐겨 찾기 소식 및 팔로 잉 사용자는 작동하지 않습니다.오류 코드 34 twitter_oauth 4.9 보석

def follow(id) 
    client.friend(id) 
end 

내 컨트롤러 코드 :

{"errors"=>[{"message"=>"Sorry, that page does not exist", "code"=>34}]} 

나는 다음과 api_client 모델을 가지고 : 나는 다음과 같이 사용자 또는 마음에 드는 게시물을 따라하려고 반환 오류를 받고 있어요

def update 
status = if params[:follow] 
    client.follow(params[:id]) 
elsif params[:follow] == 'false' 
    client.follow(params[:id]) 
end 

respond_to do |format| 
    format.json do 
    if status['screen_name'] == params[:screen_name] 
     success = true 
     notice = if params[:follow] == 'true' 
     "You are now following #{status['screen_name']}" 
     else 
     "You are no longer following #{status['screen_name']}" 
     end 
    else 
     success = false 
     notice = 'Something went wrong. Try again in a couple of seconds.' 
    end 
    render :json => {:success => success, :message => notice}.to_json 
    end 
end 
end 

다른 누구도이 문제가 발생했거나 진행 상황을 파악할 수 있습니까?

답변

1

나는 보석 자체가 문제라는 것을 알았다. 현재 0.4.9 버전의 젬은 진행중인 작업이고 일부 포스트 경로는 새 API를 반영하지 않습니다. 나는 repo를 포크하고 검토를 위해 작성자에게 변경 사항을 제출했습니다. 내가 필요한 변경 사항은 보석의 favorite.rb 및 friendships.rb 파일에있었습니다.

favorites.rb

def favorite(id) 
- post("/favorites/create/#{id}.json") 
+ post("/favorites/create.json?id=#{id}") 
end 

def unfavorite(id) 
- post("/favorites/destroy/#{id}.json") 
+ post("/favorites/destroy.json?id=#{id}") 
end 

friendships.rb

def friend(id) 
- post("/friendships/create/#{id}.json") 
+ post("/friendships/create.json?user_id=#{id}&follow=true") 
end 

def unfriend(id) 
- post("/friendships/destroy/#{id}.json") 
+ post("/friendships/destroy.json?user_id=#{id}") 
end 
: 여기가 보석으로 만들어진 네 개의 변경 사항은