nullscreen / fb-video

Funky is a Ruby library to fetch data about videos posted on Facebook.
MIT License
7 stars 6 forks source link

A URL should not be a valid Facebook page #87

Closed claudiofullscreen closed 7 years ago

claudiofullscreen commented 7 years ago

This code

Funky::Page.find('google.com/dfdf')

correctly raises an error

Funky::ContentNotFound: Error 400: {"error":{"message":"Unknown path components: \/dfdf","type":"OAuthException","code":2500,"fbtrace_id":"CRHmwoGL1pe"}}

while this code

Funky::Page.find('FoxMovies')

correctly works

#<Funky::Page:0x007ff6a23362d8
 @data=
  {:name=>"20th Century Fox",
   :username=>"FoxMovies",
   :fan_count=>23584846,
   :featured_video=>{:description=>"Kingsman: The Golden Circle trailer coming tomorrow.", :updated_time=>"2017-04-23T13:07:26+0000", :id=>"1398396143549811"},
   :id=>"121150347941070"}>

However this code should raise an error (like the first example):

Funky::Page.find("https://www.facebook.com/pg/FoxMovies/videos/?ref=page_internal")

but instead returns:

=> #<Funky::Page:0x007ff6a1fc9f00
 @data=
  {:og_object=>{:id=>"1422854821081236", :type=>"website", :updated_time=>"2016-12-24T16:25:29+0000"},
   :share=>{:comment_count=>0, :share_count=>0},
   :id=>"https://www.facebook.com/pg/FoxMovies/videos/"}>