After getting some of my friends request today I developed this project and released as Open Source GPL License. This is a php, jquery base application.This applications uses the api of facebook, linkedin and twitter to update user’s status on those sites. So you’ll publish one status that will update on 3 sites instantly.
This application will be very helpful to learn fbconnect, facebook extended permission and api to update status, oAuth for twitter and linkedin authentication. And also to learn linkedin api, twitter api usage.
visit http://thinkdiff.net/demo/fblinkedtwit/index.php to see the demo.
On the right side of the demo, you’ll see FBConnect button, Give Twitter Access and Give Linkedin Access Button.
If you want to update status in facebook, after connecting the site using FBConnect you’ve to give special permission by clicking Status Update permission. Otherwise facebook status will not update.
On the right side write something and click Update Status. If you already give access permission for facebook, linkedin and twitter your user status will update.
So read the wiki to know how to install this application for your purpose.
http://code.google.com/p/facebook-twitter-linkedin-status-update/wiki/introduction
Source Code
http://code.google.com/p/facebook-twitter-linkedin-status-update/
You could also checkout the latest svn code from http://facebook-twitter-linkedin-status-update.googlecode.com/svn/trunk/
or
download the zip file from http://code.google.com/p/facebook-twitter-linkedin-status-update/downloads/list
To learn more about twitter app visit: http://thinkdiff.net/php/develop-auto-post-publishing-twitter-app/
To learn more about linkedin app visit: http://thinkdiff.net/linkedin/integrate-linkedin-api-in-your-site/
If you want to contribute for this project, don’t hesitate to contact with me. I’ll add you as a member in the google groups where you could participate to update the project.
I hope this application will help you








another very nice work from captain. and surprisingly, i was working in a project which required exactly these three status services to update
carry on tiger
this is not working,could you help me ?
another excellent work…. keep going.
I’m currently working through this post. I have tried to connect to Twitter and have modified the files accordingly, However once I connect to Twitter and try to submit the post it doesn’t post :S
I haven’t saved the tokens into the database yet because I want to test the Sessions firstly. The code is below, anything missing? Any help would be much appreciated. Thanks Captian fantastic work by the way.
The status update
facebookStatusUpdate($status); //twitter status update if (isset($_SESSION['twit_oauth_access_token']) && isset($_SESSION['twit_oauth_access_token_secret'])){ $fblinkedtwit->twitterStatusUpdate($status, $_SESSION['twit_oauth_access_token'], $_SESSION['twit_oauth_access_token_secret']); } //linkedin status update if (isset($_SESSION['requestToken']) && isset($_SESSION['oauth_verifier']) && isset($_SESSION['oauth_access_token'])){ $fblinkedtwit->linkedinStatusUpdate($status, $_SESSION['requestToken'], $_SESSION['oauth_verifier'], $_SESSION['oauth_access_token']); } } ?>Its Working….. bur where did you get it from???
I have managed to fix it
alot of echo for comments and rechecking. All that I needed to do was to check the paths and take out of of the folders i had it all in. Sorry about that.
Just one question what the best way to store the tokens into a database linking it to the users?
@Mo, instead of storing keys into session you can store them in database. Just checkout the code to see which tokens are stored in session.
Salawalecum/ Hi,
i have used your code, its superb,
i have one issue with sessions—-
first am into index.php—>controls transfer to linkedin/twitter site, once authentication done,,,control coming back to callback page(index.php), here my session getting expired, due to that $_SESSION['authToken'] and some other session value are blank, because control was away using HEADER function.
i their any precaution in php.ini, so that my session will alive,even after HEADER method ,
please reply
jazakalla/thanks in advance
i can’t update fb status. when i click update status, is set “Error occured”. Can yu hel me??
@ronny, first be connected by clicking FBConnect on the left side and then click Give Status Update Permission and give status update permission.
This is a great site and full of info!
We have been searching on how to build something like this (http://www.mattcosta.com/pheasantsessions/)
It has the “download/promo code” once user has tweeted of facebooked. Giving them an incentive to do so.
Can you point us in the right direction? Looks like we get lost on the callback_url and how we display the link/promocode.
thanks for all the info on your site. I have book marked it.
i’ve try ur script, and work fine on Facebook and Linkedin, but it didn’t update my Twitter status..
@Doddy, let visit http://twitter.com/mahmudahsan and look i just updated my status using this application.
@Jack, I tested your example and its easy to develop. When user first approve your twitter app then you can redirect him to the index page or another page with some parameter as a get request. Then check if something like if isset($_REQUEST['s']) then show him a pop up window, when user write something and click publish then redirect him to the download page. Here you can set session or use get parameter to validate.
Salam Alaykoum
Very very nice,
i try now to build this application in my website.
it’s work elegant, but how i can make, that user once “Give Status Update Permission”, and if he’s account already acticated, then “Give Status Update Permission” must not appear
Jazak allah khayran mahmoud
@Ahmad Ismail,
Yeah you can easily do that by a if else logic. If you want to check using php then check the api
http://wiki.developers.facebook.com/index.php/Users.hasAppPermission
if you wanna check using javascript check the api http://developers.facebook.com/docs/?u=facebook.jslib.FB.ApiClient.users_hasAppPermission
wow…. thanks a lot………. i am working in a project which required two status services(twitter and Facebook) to update.. and your application help me a lot………
Thanks Again……….
demo : http://www.arabic-keyboard.org/status
thank you
@Ahmad Ismail, good demo. I like it.
Assalamualaikum,
Thank you very much for your source code. I have put the code on my website. The code works fine for Facebook, but they failed for Twitter and Linkedin. When I click “Give Twitter Permission” the page give error read Fatal error: Call to undefined function hash_hmac() in /akuai/unipa/updatestatus/unipanet/linkedin_twitter/OAuth.php on line 117. Line 117 on OAuth.php read : return base64_encode(hash_hmac(‘sha1′, $base_string, $key, true));.
Is there something wrong in my configuration or server? Please help me solve the problem.
Thank you in advance.
Wassalamualaikum
Ery
Dear Mr. Mahmud Ahsan, I am using PHP version 5.10 on Linux Gentoo server.
Thank you very much in advance.
Wassalam
Ery Atmodjo
Dear Mr. Mahmud Ahsan.
I found that error was because PHP is installed with hash disabled. I reinstalled PHP and the code works fine.
However, Facebook and LinkedIn status were updated while Twitter status was not updated. Please help me solve the problem. Twitter Information appear on my website. In application website field of Twitter application, I have to put mysite/index.php or mysite/twitter.php?
Thank you very much in advance.
Wassalam
Ery
@Ery Atmodjo, I just checked my demo and I found the code is working nicely for twitter also.
For this application the callback url is set to: http://thinkdiff.net/demo/fblinkedtwit/twitterauth.php
and Application Website is set to http://thinkdiff.net/demo/fblinkedtwit/index.php
Assalamualaikum,
I replace mysite/twitter.php with mysite/index.php and it works nicely.
Thank you very much, you are very helpfull.
Wassalam
Ery
Hello,
I’ve got a problem, when i try to connect with Facebook, the popup show me this message :
“The application you are trying to access does not exist or has been disabled.”
Why ? My Api id is correct..
Thanks you.
ah.. and for Buzz is there anything else ?
)
Compliments for this great works.
Hi Daniele, i think the code is ok and it should run correctly in your server. Please check if api key and secret key and callback url are ok or not.
Thanks for the answar
it’s seams ok .. my demo is here : http://login.houndseotool.com/apps/
what’s wrong ?
Can You tell to auto permissions .. I mean without click “Give status update permission”
How user can send updates to the facebook?
Kindly instruct me with code…
Please update fbconnect system with facebook new javascript sdk. Follow my tutorial http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/ at the allow access time this approach request user to give permission. So next time we don’t need to prompt user for giving permission.
Thanks you very much .
Can you improve this great script also for google buzz and myspace ?
@daniele, If I could manage time I’ll surely update it. thanks for your suggestion.
Faced the following wrror while browsing your demo link. Will you please have a look?
”
Fatal error: Cannot redeclare class OAuthException in /home/mahmud/public_html/demo/fblinkedtwit/linkedin_twitter/OAuth.php on line 9
“
@Himel vai, hmm strange, when I published this article that time the error was not occurred. Whatever I removed
class OAuthException extends Exception { // pass }these lines from oAuth.php and now the demo is working nicely.
hmm very strange! though I didn’t understand the reason behind!
thanks for noticing!
Hello Ahsen,
I am trying to use your code to update a group wall by the method stream_publish but I can not have the permission. Could you please help me in this issue.
Thanx.
Checkout http://thinkdiff.net/facebook/update-facebook-page-status-automatically/ this article. It may help you to get the idea how to publish on page wall. I think the same technique can help you to publish on group wall.
Hola, I find this interesting, I will have to try your information
Dear Mr. Mahmud…
How can post include a photo or image, media? just text status it’s okay.
In my project I want to post status include google map image by location on facebook, I can not find how it in this article, thanks
This is status update application, if you want to post photo or video you have to update the code and have to use publish stream method in facebook. checkout my other article http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/ to learn more and also http://developers.facebook.com/docs/api
thanks Mr. Mahmud…
in this source code I think using old facebook.php source code, is there latest sample using latest facebook.php?
I have tried stream_publish() command in this sample but error raised like
Fatal error: Call to undefined method FacebookRestClient::stream_publish()
when I trace it’s, I get conclusion that is old facebook.php, hmm… what do you think, Mr. Mahmud?
Ofcourse this is implemented using the old rest api and many days ago, I couldn’t manage enough time to update this code.
I am receiving the following error. Testing on live server:
Notice: Array to string conversion in C:\Websites\Whisper\scripts\linkedinoAuth.php on line 122
Notice: Undefined index: oauth_token in C:\Websites\Whisper\scripts\linkedinoAuth.php on line 41
Notice: Undefined index: oauth_token_secret in C:\Websites\Whisper\scripts\linkedinoAuth.php on line 41
Authorization URL: https://api.linkedin.com/uas/oauth/authorize?oauth_token=
Has anyone seen this?
I’ve seen the same problem while testing on a local server (WinXP, Wampserver with Apache 2.2.11 & PHP 5.2.11). It disappeared when moving the code to a remote server (Linux, Apache 2.0.63, PHP 5.2.14). Not sure what caused it…
Dear KVN…
try using isset for line 41 for checking if it exist…
Thanks
Great I have read your article and by the way I found you website on Yahoo and I think after I read somepost on you website especially this one I have my own opinion about what should I tell on the next meeting with my family, maybe tonight I will tell my friendsabout this one and get debate.
nice application
i’ll try it with re design layout
thanks
Another cool and very useful application from you bro, thank you very much.
Hello there,
how can i update my facebook status from my site without login to facebook…
i checked your application its great!!!!
Thanks,
Sonali.
without fb login, its not possible. If use approves status_update and offline_access extended permission to your application only then you can update status of that user without user’s login.
When I run twitter status update from my website, I am getting HTTP status code 413. Any idea why it is?
Hi,
I’ve created a facebook application and using your source for updating the status. It throws the following error
Application Temporarily Unavailable
Parse errors:
FBML Error (line 12): illegal tag “body” under “fb:canvas”
FBML Error (line 19): illegal event “onlogin” in tag “fb:custom-tag”
Sorry, the application you were using is experiencing a problem. Please try again later.
This is happening on the Facebook app. Please help.
Thanks in advance.
Neetu, facebook deprecated their old library that I used in this application when I published this post. So please checkout my new article and follow how to update status. http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
Hi!
Thanks for this great piece of code. I got the whole thing running and everything but I only know how to update Facebook status with text. I would like to know to add a link and picture underneath the user comment on his wall, such as the example that can be accessed from the facebook icon at the begging of the article on this page.
Thanks,
Maxime
Please checkout my other tutorials about facebook, you’ll find your answer.
hye Mahmud…
thank you for this great tutorial and example..
id follow all your guidance and make 3 app as follow on ur instructions.. but still get this pop up error occured..
id fixed the path also..
my link woulde be http://hide.my/status/
thanks..
bulp
Mahmud bro,
I tried with your demo. It says status is updated but on linkedin site I do not see the status! what’s causing this?
Ok, I guess it is working! but it appears on linkedin site at least 10 minutes later! shit!
What if we don’t want to show and use “Give Status Update Permission” link at all? . Specifically for facebook.
Any Help will really be appreciated
Thanks
once again, your example and steps was help me. god bless you!
I have used this script….working fine for facebook but not for twitter.I have updated twitter status and got response “status updated successfully” but not reflecting in to my twitter home page. Please tell solution.
Hi mahmud,
Can you please let me know the similar example with coldfusion
Thanks,
Shariff
Hi Shariff,
I’m sorry to say that I don’t know Cold fusion. :S
How can i transfer status update textarea content into a variable?
Fantastic post and wonderful blog, I really like this type of interesting articles keep it up.
Nice work!!
Custom Fan Page
Fast and easy way to update status in twitter with PHP in 2 steps – http://ayauho.com/~ay
Hi Mahmud. Thank you so much for the code. I really like it. I want to ask a question. How to create facebook application to post on friend’s wall? Would you like to post a tutorial or source code of it? Thanks in advanced.
This is very easy using graph api. Checkout http://developers.facebook.com/docs/reference/api/post
Can you give an example or a complete source code. I’m a newbie. This is my first app. Thanks.
Is there a way to search linkedin/facebook/Twitter public user base without login?
Or
Can I set an application on my end that will do it with one user/pass but with unlimited searches and in parallel
I hope I am clear here
Thanks
Great tutorial. I uploaded your code and have the facebook and linkedin status updates working very well.
The twitter update does not work. I’ve set the Callback URL and Keys as you defined in your installation guide, but it does not work properly.
When I click “Give Twitter Access”… it take me to twitter to ALLOW the application. When it returns me back to */index.php … it has not logged me into twitter.
Not sure why the log in function is not working. Can you think of any reason for this and changes I should make.
Your help is much appreciated.
Hank
Further to my issue… after some debugging…
Its seems like I am not receiving the ‘twit_oauth_access_token and twit_oauth_access_token_secret
So this if statement in the index.php does not return TRUE
if (isset($_SESSION['twit_oauth_access_token']) && isset($_SESSION['twit_oauth_access_token_secret'])){
should my Registered OAuth Callback URL ve set to twitterauth.php?
I uploaded your code and have the facebook and linkedin status updates working very well. thankyou
have you got the twitter function working?
Ci tenevo a dire, oltre a fare i dovuti complimenti, che i post di questo sito sono sempre interessanti da leggere!
Very nice tutorial, thank you!
I read this article (http://developers.facebook.com/blog/post/503/), and I think you should refresh your code soon!
The Facebook Javascript SDK will change.
PS. the facebook logout doesn’t work for me. It redirects me to my Facebook profile, but if I come back to the application, I’m still logged in.
well,facebook developers api has changed.facebook no longer support api key,so edit the script
This is exactly what I have been looking for, Facebook and LinkedIn updates great, but I still can’t get Twitter to work. I can Give access, and it shows all my Twitter info, and when i post it tells me it posted to Twitter successfully, but nothing shows up on my Twitter profile. Any ideas?
Is there a simple way to automatically log in a user to all three sites? So they don’t have to give access to all three each time? I am using this for a variety of people, a lot of which want things as simple as possible (go figure). They will have to log in to a private area of their website to access this anyway, so is there anyway to have these logins just happen like with Ping.fm?
Awesome work buddy, find so many sites but didn’t find anywhere else…
Hi mahmud,
Thanks for this amazing post. Its really useful.
Can we integrate same with CodeIgniter?
Please let me know.
Thanks.
Yeah you can implement the code in CodeIgniter.
I need to update status on facebook and twitter. .
I have uploaded your code. ..it’s working fine in facebook but not in twitter ..
I’ve set the Callback URL and Keys as you defined in your installation guide, but it does not work properly.. .
callback url: http://wirkochenfair.ch/fairtrade/status/twitterauth.php
website url : http://wirkochenfair.ch/fairtrade/status/index.php
please, help me. .
it’s give me the message:
Twitter status updated successfull!
but status has not been updated at twitter.. .
Great post and tutorial. Can you tell me if it’s possible to update a facebook fan page using this tool? I know that it can be done as hootsuite is doing it?
The code used in this application for facebook task is old. You’ve to update the code. And to update/post in facebook fan page, install your app in your fan page, take publish_stream permission and using token i think you could publish in fan page.
Stylish.. bro.. !!
Your code rocks! Super easy, direct to action and working in 5 minutes!
Thanks Mahmud!
testing your code, super tool ! One issue (and read it from other testers). It seems I cannot update twitter (but is shows “succesfull”). Any idea ?
Another item, can I use this tool for multiple pages / accounts ?
Note: it works fine, changed “WebSite: *” in twitter app into app website instead of siteroot index.
On the other hand , can I use this tool for multiple pages / accounts ?
Hi, Gys, can you tell me exactly what change you made in “website” box in Twitter app?
because it’s not working for me…
Twitter status is not updating…
and cannot understand the above Comment which says it’s works fine…
Help…
Hello,
I was working on a similar thing, and came across your solution, but here I see that the facebook status update is giving some error when i tried your demo, other two work fine.
Can you please look into this and respond?
Thanks,
Asad
@mahmud ahsan , i tried this code on free hosting and domain but it doesnt work . i created app. and inserted API and secret key , but it is not updating fb status . pls help me , pls check the link http://fbstatus.site40.net/
i need this script to work .
thanks
please i need the application to update for twitter.. am not good at coding can anybody help me : (
cool, this application is very helpful to me, but there is little problem in my application, when I click “update Status Give Permission” or “Give Twitter Accsess” and does not redirect back to my application, how the solution?
Hi Mahmud,
does this script still work? I have tried implementing the facebook and get as far as seing the “Give Status Update Permissions” but when i click it the page seems to refresh ajaxically but it won’t update my fb status.
fyi: my facebook object doesn’t have an ID value. when I fake it by adding the facebook page ID it returns the failed update message.
any help would be great.
fantastis http://rumahdietnutrisi.com
Ok. I used this with succes on my site for long time. Problem is next:
1. ziped all folders and transfer to another domain which is on same server
2. change parameter for: config.php according to new domain
3. run the site. when i try to login with Twitter first error says: “Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/XXX/public_html/XXX.php:9) in /home/XXX/public_html/XXX.php on line 2″. Ok, i fix this session…
4. when user press button Sign in with twitter i got this error which drive me crazy for two days: “Fatal error: Cannot redeclare class OAuthException in /home/XXX/public_html/XXX/linkedin_twitter/OAuth.php on line 9″ !!!
Now, i read whole blog. U say to erase line in file OAuth.php >>> “class OAuthException extends Exception {
// pass
}”. Done that. But not redirect me to where supposed to. Keep backing me to starting position, Sign in with twitter…
Once again. On my old site, work 101% like a charm. U can send me email and i will send you the link of the working site. On my new site – NO WORK BRO!!! I will also send you the new site domain. Now, i also changed whole data to twitter developer application to point to new site. Change user secret etc…
Any help with this? Please, you have my email for this comment. Contact me.
Thank you.
Hi,
I didnt get the request token for Linkedin..\
can any one please help me….
Please any one help me , its very urgent..