Before anything you need to create a key for your app Here.
Then go to the Apps tab, Create New App
After the app created you can catch the APP ID
here:
After that, you can use the share button on each of the contents like this.
In the HTML
:
<div class="fb-share-button" data-href="/questions/10272/postagens-automaticas-no-facebook" data-type="button_count"></div>
In the Javascript
:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=XXXXXXXXXXXXXX";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
In place of XXXXXXXXXXX you must put the key to your app.
You can use the cURL
as indicated here
But I believe it’s much simpler to use the PHP
for this task, because you will need the access token, achieved only after logging in with your
app on API
of Facebook
.
To automate using PHP
you must use the Facebook
, using the SDK
in PHP
.
Here has the link to the documentation of SDK
And here has an example of how to post using PHP
and the API
of Facebook
The steps to the creation of APP ID
are the same
Better define what your system is like and what would you like to do? The "click with Curl" part is not very clear. This other site that has the share button is yours or someone else’s?
– Leonardo Otto
I’ll try to describe it better, the site is someone else’s, every day I have to log on to this site, log in and password to it, and then click on a share button that’s there, and share the content within a group that I have on facebook. What I wanted the system to do was make it all automatic, with Curl, without me having to log in, click, share, you know? I just ran the script and it did everything.
– João Neto
Do you necessarily need to use Curl? This sounds more like your automation task. If you can use other tools you can try using Autoit or Autohotkey which server to automate these desktop tasks of yours. Or Selenium, which will automate this task for you to click the share button. There is even a bind to Selenium using PHP here -> http://docs.seleniumhq.org/download/
– Leonardo Otto
It does not necessarily have to be with Curl, but I want to make a system that is not restricted to me, after I can do it for myself, I want to be able to do it for several people by storing their data (with clear concretion). After all I want when I run the script, one by one the system enters, shares, exits, enters, shares and exits. But I’ll take a look at Lenium, thanks.
– João Neto