Closed weyus closed 11 years ago
Could you send me the actual JSON response?
Sure. From which call do you want it - the call to the home feed, I assume?
Yeah, home feed.
I'm assuming FB returns a location
in a place
in a post
as an JSON String, not as an JSON Object containing latitude
, longitude
and country
. (as described in the below document)
https://developers.facebook.com/docs/reference/api/post/
So I want to know how/why such data is generated and whether I need parse it or just omit it.
If you could find such "undocumented" format of location data in your GET /me/home?access_token=**
response, that exact one line is also enough.
Here's the the relevant part of the post that fails on this user - just like you said, the location inside the place is a string. I suspect that this is the first post that has a "place" attribute in this particular home feed.
"place"=>{"id"=>"462904087116641", "name"=>"Phi Psi Woodstock's Fundraiser!", "location"=>"Woodstock's Pizza San Diego", "start_time"=>"2013-04-10T17:00:00-0700"},
Are you still getting the error? I just made a post with "non-structured" location tag, but get no location data in the post via Graph API. https://www.facebook.com/matake/posts/10151584232307277
FB might already fixed (or just turned-off) such non-structured location data.
{
"id": "579612276_10151584232307277",
"from": {
"name": "Nov Matake",
"id": "579612276"
},
"message": "test test",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/579612276/posts/10151584232307277"
},
{
"name": "Like",
"link": "https://www.facebook.com/579612276/posts/10151584232307277"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"created_time": "2013-04-15T09:42:22+0000",
"updated_time": "2013-04-15T09:42:22+0000",
"comments": {
"count": 0
}
}
If you still getting the error, I'll allow simple string location
.
I got it to happen on the same user, but this time it failed on a different post. Same format for the :place key, though:
"place"=>{"id"=>"237900519680678", "name"=>"MuirSkate's Downhill Disco (2013)", "location"=>"Cara Way, San Diego, CA", "start_time"=>"2013-04-12T18:00:00-0700"}
I looked at this post in the Graph API Explorer, and the story was of the format:
""story": "X was tagged in Y's photo."
so it's not a regular status update.
I also run into this problem, hasn't it be fixed? I think it was caused by different version of facebook. You can see the old user page: http://www.facebook.com/coldplay/info. But I wonder why not its api reference explain it?
Hopefully, I can take a few hours to debug the issue in this evening..
I'm guessing story
is not post
but another object type.
Hum, I can make story
type of post
by tagging photos etc.
However, even I attached a location to the post with "just use ***" option, graph api doesn't return location data.
If I attached structured location (as a FB page), graph api returns it.
Maybe they have some internal bug in some cases, I guess. For now, I just ignore the non-structured location data in graph api response. (I don't think such location data is what you want)
Just released v2.6.7 with the fix. Please try it.
cool, I'll try it :)
It seems that the hometown problem hasn't been fixed?
hometown problem? maybe it's different issue?
this issue? https://github.com/nov/fb_graph/issues/231 or https://github.com/nov/fb_graph/issues/232 I think hometown has the similar problem.
Perhaps the source of the story is the issue - a mobile FB client?
Given that "sean.facebook_user" (in my app) is a FbGraph::User, if I issue
I get:
Looks like when you get the posts for the home feed, if they have a "place" attribute that is a Hash, then it is not being handled correctly.
This appears to be similar to Issue 231 which resulted in Todo 232. Should I attempt to use the workaround described in the ToDo?