Dear Community,
is there an easy way to make Posts to Facebook, Twitter, Instagram + Co from a fiwewin-application?
Thank you for your answers.
Kind regards
Iris
<?php
// require Facebook PHP SDK
// see: https://developers.facebook.com/docs/ph ... ngstarted/
require_once("/YOUR_PATH_TO/facebook_php_sdk/facebook.php");
// initialize Facebook class using your own Facebook App credentials
// see: https://developers.facebook.com/docs/ph ... d/#install
$config = array();
$config['appId'] = 'YOUR_APP_ID';
$config['secret'] = 'YOUR_APP_SECRET';
$config['fileUpload'] = false; // optional
$fb = new Facebook($config);
// define your POST parameters (replace with your own values)
$params = array(
"access_token" => "YOUR_ACCESS_TOKEN", // see: https://developers.facebook.com/docs/fa ... ss-tokens/
"message" => "Here is a blog post about auto posting on Facebook using PHP #php #facebook",
"link" => "http://www.fivetechsoft.com",
"picture" => "http://forums.fivetechsupport.com/styles/prosilver/imageset/site_logo.gif",
"name" => "How to Auto Post on Facebook with PHP",
"caption" => "www.fivetechsoft.com",
"description" => "Automatically post on Facebook with PHP using Facebook PHP SDK. How to create a Facebook app. Obtain and extend Facebook access tokens. Cron automation."
);
// post to Facebook
// see: https://developers.facebook.com/docs/re ... ebook-api/
try {
$ret = $fb->api('/YOUR_FACEBOOK_ID/feed', 'POST', $params);
echo 'Successfully posted to Facebook';
} catch(Exception $e) {
echo $e->getMessage();
}
?>
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 128 guests