Get and put them in the same directory (for exampleįacebook_php_sdk ). fb_ca_chain_bundle.crt (SSL certificate).Get Facebook PHP SDKĭownload Facebook PHP SDK (v.3.2.2 at the time of writing thisĪrticle) from Github at You may use any library available (in PHPĪctually, you need three files (under folder src) ( Demo_auto_post_php) created just for demo purposes and Make the whole process more understandable. Information like app secret, access tokens etc. ( Demo_auto_post_php) without hiding “sensitive” Profile or for your Fan Pages or Business Pages (line 29)Īll these steps are described below. you have to get your Facebook id, either for your Personal.you have to renew Access Token after expiration (about 60.you have to get an Access Token, so your app can be post on.
you have to create a Facebook app in order to use Facebook API.you have to use Facebook PHP SDK (line 4).$ret = $fb->api('/YOUR_FACEBOOK_ID/feed', 'POST', $params) Obtain and extend Facebook access tokens. "caption" => ""description" => "Automatically post on Facebook with PHP using Facebook PHP SDK. "name" => "How to Auto Post on Facebook with PHP", "message" => "Here is a blog post about auto posting on Facebook using PHP #php #facebook", The following PHP script can be invoked from command line (or
Your Facebook Profile or your Fan Pages or Business Pages.ĭetailed instructions are provided below in this post.
#Auto friend adder facebook app code
(without link), or to upload a photo in a Facebook album.Īlso, with small changes you can use this code to post either to With small changes you can use this code to post just a message Here is the code you need to share a link to Facebook using PHP. Never expire (according to current Twitter policy), whileįacebook Access Tokens will expire in 60 days. For example,Įxcept of a Facebook Personal Profile, you may have Fan Pages orĪ significant difference is that Twitter Access Tokens will This is not a surprise, asįacebook itself is much more complicated than Twitter. However, the Facebook post automation is much more complicated You have to create a Facebook app and you need a PHP SDK