From Facebook Graph Api (https://developers.facebook.com/docs/reference/api/) :
Publishing: You can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs, using an access
token. For example, you can post a new wall post on Arjun’s wall by
issuing a POST request to https://graph.facebook.com/arjun/feed:
curl -F 'access_token=...' \
-F 'message=Hello, Arjun. I like this new API.' \
https://graph.facebook.com/arjun/feed
- Q1: is this a javascript or php ?
- Q2: I don’t see “curl -F”
function reference nowhere, can someone pls show me one ?
Many thanks ~
curl(orcURL) is a command-line tool for accessing URLs.Documentation: http://curl.haxx.se/docs/manpage.html
In this example, they are simply sending a POST to
https://graph.facebook.com/arjun/feed. The-Fis defining parameters to be submitted with the POST.This is not javascript or php. You can use curl in php, although any POST to that address with those parameters will accomplish what the example is demonstrating.
To do this in javascript, you would create a form and then submit it:
Using jQuery, it’s a lot simpler: