0
我有以下像帶簡單URL調用Facebook頁面完美的工作:www.facebook.com/TurbonegroHQ的Rails 3.1 - Facebook的頁面API調用
def get_facebook
@artist = Artist.accessible_by(current_ability).find(params[:id])
if @artist.facebook_url.present?
require 'open-uri'
require 'json'
result = JSON.parse(open("https://graph.facebook.com/"<<@artist.facebook_url).read)
@hometown = result["hometown"]
@band_members = result["band_members"]
@likes = result["likes"]
end
end
然而,當一個Facebook頁面的網址是不是以這種格式,但它像https://www.facebook.com/pages/Clutch-The-Bakerton-Group-Weathermaker-Music/16637738637它失敗。任何想法如何解決這個問題?
在此先感謝?