Closed giovannelli closed 11 years ago
The post you are requesting returns a message tag of this format :-
"message_tags": [ { "id": "38919051253", "name": "O2", "type": "page", "offset": 117, "length": 2 } ]
FBGraph is expecting it to be in
"message_tags": [ "0": { "id": "38919051253", "name": "O2", "type": "page", "offset": 117, "length": 2 } ]
Any idea what's the reason that this response do not return a key value hash?
The latter is the expected format of message_tags
in post object.
object containing fields whose names are the indexes to where objects are mentioned in the message field; each field in turn is an array containing an object with id, name, offset, and length fields, where length is the length, within the message field, of the object mentioned
https://developers.facebook.com/docs/reference/api/post/
However, 10151464423983204_26704105111
is a comment object, not a post.
And now I realized FB includes message_tags
in comments too.
ps.
You can see FB Graph API object type by putting metadata=true
in query.
e.g.) https://graph.facebook.com/10151464423983204_26704105?metadata=true
ps2.
message_tags
in comments seems undocumented attribute yet.
If you need them, we can add them, but if not, let's ignore them for now.
https://developers.facebook.com/docs/reference/api/Comment/
Yes it includes message_tags in a different format.
Many tnx
Duccio
Since its a comment, you can probably use FbGraph::Comment.new(..)
.fetch
That will not raise any error, that's because its not mapping the message_tags directly
Anyhow you can access it via comment.raw_attributes["message_tags"]
Ok tnx, i'll use FbGraph::Comment instead of FbGraph::Post and i access message_tags using raw_attributes. Cheers
Hi, i'm getting undefined method each for some facebook posts, seems that "message_tag" at line 44 in post.rb is nil.
Try this: _FbGraph::Post.new("10151464423983204_26704105", :access_token => a_validtoken).fetch
You get: NoMethodError: undefined method `each' for nil:NilClass
I've solved with this:
or
The same problem on story_tags i think, even if i've not find till now a story with this issue.
Cheers