I get this error while trying to obtain the number of shares and likes of the particular link on Facebook:
{
"error_code":601,"error_msg":"
Parser error: unexpected ''' at position 56.",
"request_args":
开发者_如何学编程 [{"key":"method","value":"fql.query"},
{"key":"format","value":"json"},
{"key":"query","value":"SELECT share_count, like_count FROM link_stat WHERE
url='http://www.lrinka.lt/index.php?act=main"},
{"key":"item_id","value":"5963'"}]
}
The link: http://www.lrinka.lt/index.php?act=main&item_id=5963
The API call: https://api.facebook.com/method/fql.query?format=json&query=SELECT%20share_count,%20like_count%20FROM%20link_stat%20WHERE%20url=%27http://www.lrinka.lt/index.php?act=main&item_id=5963%27
Everything works fine with other links.
You are not closing the url
parameter field correctly, missing '
at the end of the URL.
Also no need for the "slashes", try the following in the fql.query console:
SELECT share_count, like_count FROM link_stat WHERE url='http:\/\/www.lrinka.lt\/index.php?act=main
Would return the same error, and this:
SELECT share_count, like_count FROM link_stat WHERE url='http:\/\/www.lrinka.lt\/index.php?act=main'
Is valid but would return zero, and finally this:
SELECT share_count, like_count FROM link_stat WHERE url='http:\\www.lrinka.lt\index.php?act=main'
Would return the result expected.
EDIT:
Based on your comment, you are trying to call https://api.facebook.com/method/fql.query?query=QUERY
with the format
parameter set to json
..so you need to encode the query, I used encodeURI
:
https://api.facebook.com/method/fql.query?format=json&query=SELECT%20share_count,%20like_count%20FROM%20link_stat%20WHERE%20url='http:%5Cwww.lrinka.ltindex.php?act=main'
精彩评论