Open Source Facebook, Twitter & Linkedin Status Update Application

facebook-twitter-linkedinAfter 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 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.

facebook-twitter-linkedin status update

So read the wiki to know how to install this application for your purpose.

Source Code
You could also checkout the latest svn code from
download the zip file from

To learn more about twitter app visit:
To learn more about linkedin app visit:

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 :)

mahmud ahsan

Love computer programming and write occasional blog post. In my early career I worked mostly on web based application and since 2011, I exclusively working on iPhone and android applications. I work at home, father of a nice kid and husband of a beautiful wife. [My Business | Twitter | Linkedin]

You may also like


  • hasin
    March 25, 2010 at 12:05 am

    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 :)

    • varun
      April 16, 2013 at 11:43 am

      this is not working,could you help me ?

  • জামান-এ-পিরি পাশা
    March 25, 2010 at 12:59 am

    another excellent work…. keep going.

  • Mo
    March 28, 2010 at 5:49 am

    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

        //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']);
    • Kashyap
      September 20, 2011 at 5:05 pm

      Its Working….. bur where did you get it from???

  • Mo
    March 28, 2010 at 7:40 am

    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?

  • mahmud ahsan
    mahmud ahsan
    March 28, 2010 at 12:03 pm

    @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.

    • Allabakash
      August 17, 2011 at 10:19 am

      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

  • ronny
    March 31, 2010 at 4:52 pm

    i can’t update fb status. when i click update status, is set “Error occured”. Can yu hel me??

  • Mahmud Ahsan
    March 31, 2010 at 5:37 pm

    @ronny, first be connected by clicking FBConnect on the left side and then click Give Status Update Permission and give status update permission.

  • Jack
    April 2, 2010 at 7:35 am

    This is a great site and full of info!

    We have been searching on how to build something like this (

    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.

  • Doddy
    April 2, 2010 at 10:54 am

    i’ve try ur script, and work fine on Facebook and Linkedin, but it didn’t update my Twitter status..

  • mahmud ahsan
    mahmud ahsan
    April 2, 2010 at 12:31 pm

    @Doddy, let visit and look i just updated my status using this application.

  • mahmud ahsan
    mahmud ahsan
    April 2, 2010 at 12:38 pm

    @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.

  • Ahmad ismail
    April 5, 2010 at 8:47 am

    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

  • mahmud ahsan
    mahmud ahsan
    April 5, 2010 at 4:17 pm

    @Ahmad Ismail,
    Yeah you can easily do that by a if else logic. If you want to check using php then check the api

    if you wanna check using javascript check the api

  • tasid
    April 13, 2010 at 8:44 pm

    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……….

  • Ahmad ismail
    April 13, 2010 at 9:48 pm

    demo :

    thank you

  • mahmud ahsan
    mahmud ahsan
    April 13, 2010 at 10:25 pm

    @Ahmad Ismail, good demo. I like it. :)

  • Ery Atmodjo
    May 1, 2010 at 2:29 pm


    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.



  • Ery Atmodjo
    May 1, 2010 at 3:02 pm

    Dear Mr. Mahmud Ahsan, I am using PHP version 5.10 on Linux Gentoo server.

    Thank you very much in advance.


    Ery Atmodjo

  • Ery Atmodjo
    May 1, 2010 at 5:32 pm

    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.



  • mahmud ahsan
    mahmud ahsan
    May 1, 2010 at 10:25 pm

    @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:
    and Application Website is set to

  • Ery Atmodjo
    May 2, 2010 at 2:00 am


    I replace mysite/twitter.php with mysite/index.php and it works nicely.

    Thank you very much, you are very helpfull.



  • daniele
    May 7, 2010 at 5:39 pm


    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.

  • daniele
    May 7, 2010 at 6:45 pm

    ah.. and for Buzz is there anything else ? :-))

    Compliments for this great works.

    • mahmud ahsan
      mahmud ahsan
      May 7, 2010 at 9:32 pm

      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.

  • daniele
    May 7, 2010 at 9:44 pm

    Thanks for the answar 😉

    it’s seams ok .. my demo is here :

    what’s wrong ?

  • james
    May 15, 2010 at 7:41 pm

    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…

  • daniele
    May 17, 2010 at 4:53 am

    Thanks you very much .

    Can you improve this great script also for google buzz and myspace ? :-)

  • mahmud ahsan
    mahmud ahsan
    May 17, 2010 at 11:19 am

    @daniele, If I could manage time I’ll surely update it. thanks for your suggestion.

  • Himel Nag Rana
    May 17, 2010 at 4:19 pm

    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

  • mahmud ahsan
    mahmud ahsan
    May 17, 2010 at 5:45 pm

    @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.

  • Himel Nag Rana
    May 18, 2010 at 4:20 pm

    hmm very strange! though I didn’t understand the reason behind!
    thanks for noticing!

  • Maged
    May 19, 2010 at 5:51 pm

    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.


  • Delbert Martabano
    June 12, 2010 at 2:20 pm

    Hola, I find this interesting, I will have to try your information

  • Saiful Amri
    July 14, 2010 at 9:16 pm

    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

  • Saiful Amri
    July 15, 2010 at 8:41 pm

    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?

    • mahmud ahsan
      mahmud ahsan
      July 16, 2010 at 1:36 am

      Ofcourse this is implemented using the old rest api and many days ago, I couldn’t manage enough time to update this code.

  • KVN
    July 22, 2010 at 10:39 pm

    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:

    Has anyone seen this?

    • Marc
      September 10, 2010 at 4:11 pm

      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…

  • Saiful Amri
    July 22, 2010 at 10:51 pm

    Dear KVN…

    try using isset for line 41 for checking if it exist…


  • Dedra Dezenzo
    August 2, 2010 at 12:53 pm

    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.

  • buzzknow
    August 6, 2010 at 11:11 pm

    nice application 😀

    i’ll try it with re design layout :)


  • Sushil Gupta
    August 9, 2010 at 12:15 pm

    Another cool and very useful application from you bro, thank you very much.

  • sonali
    August 10, 2010 at 7:17 pm

    Hello there,

    how can i update my facebook status from my site without login to facebook…
    i checked your application its great!!!!



    • mahmud ahsan
      mahmud ahsan
      August 11, 2010 at 10:46 am

      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.

  • Sathya
    August 18, 2010 at 11:45 pm

    When I run twitter status update from my website, I am getting HTTP status code 413. Any idea why it is?

  • Neetu
    August 26, 2010 at 6:03 pm


    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.

  • Maxime
    September 6, 2010 at 2:08 am

    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.

    • mahmud ahsan
      mahmud ahsan
      September 6, 2010 at 8:24 pm

      Please checkout my other tutorials about facebook, you’ll find your answer.

  • bulp
    September 13, 2010 at 12:10 pm

    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


  • The HungryCoder
    September 18, 2010 at 1:50 pm

    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?

  • The HungryCoder
    September 18, 2010 at 2:06 pm

    Ok, I guess it is working! but it appears on linkedin site at least 10 minutes later! shit!

  • Muhammad Ahmed
    October 7, 2010 at 12:32 pm

    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


  • hairul azami
    October 13, 2010 at 11:20 pm

    once again, your example and steps was help me. god bless you!

  • aslam
    November 29, 2010 at 6:16 pm

    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.

  • shariff
    December 8, 2010 at 6:15 pm

    Hi mahmud,

    Can you please let me know the similar example with coldfusion


    • mahmud ahsan
      mahmud ahsan
      December 8, 2010 at 8:00 pm

      Hi Shariff,
      I’m sorry to say that I don’t know Cold fusion. :S

  • canavar
    December 9, 2010 at 9:02 am

    How can i transfer status update textarea content into a variable?

  • jackpetter19
    January 4, 2011 at 2:13 pm

    Fantastic post and wonderful blog, I really like this type of interesting articles keep it up.
    Nice work!!
    Custom Fan Page

  • ayauho
    January 5, 2011 at 6:57 pm

    Fast and easy way to update status in twitter with PHP in 2 steps –

  • Gus
    January 7, 2011 at 3:36 pm

    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.

  • Ykoenig
    January 21, 2011 at 11:32 am

    Is there a way to search linkedin/facebook/Twitter public user base without login?

    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


  • Hank
    February 16, 2011 at 10:55 pm

    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
      February 17, 2011 at 12:00 am

      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?

  • drupal web developer
    February 25, 2011 at 7:34 pm

    I uploaded your code and have the facebook and linkedin status updates working very well. thankyou

    • Hank
      February 25, 2011 at 9:53 pm

      have you got the twitter function working?

  • film in streaming
    April 22, 2011 at 5:52 pm

    Ci tenevo a dire, oltre a fare i dovuti complimenti, che i post di questo sito sono sempre interessanti da leggere!

  • Adam
    June 27, 2011 at 1:28 pm

    Very nice tutorial, thank you!
    I read this article (, 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.

  • maruf
    July 7, 2011 at 7:49 pm

    well,facebook developers api has changed.facebook no longer support api key,so edit the script

  • Cory
    July 18, 2011 at 8:04 am

    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?

  • Cory
    July 18, 2011 at 8:09 am

    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

  • SHIV
    August 27, 2011 at 10:24 am

    Awesome work buddy, find so many sites but didn’t find anywhere else…

  • Vikrant
    September 4, 2011 at 6:35 pm

    Hi mahmud,

    Thanks for this amazing post. Its really useful.
    Can we integrate same with CodeIgniter?
    Please let me know.


    • mahmud ahsan
      mahmud ahsan
      September 4, 2011 at 7:03 pm

      Yeah you can implement the code in CodeIgniter.

  • kartik
    September 10, 2011 at 6:00 pm

    I need to update status on facebook and twitter. .
    I have uploaded your code.’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:
    website url :

    please, help me. .

  • kartik
    September 10, 2011 at 6:02 pm

    it’s give me the message:
    Twitter status updated successfull!

    but status has not been updated at twitter.. .

  • Hans
    November 13, 2011 at 3:48 am

    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?

    • mahmud ahsan
      mahmud ahsan
      November 17, 2011 at 2:38 pm

      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.

  • mithun
    November 24, 2011 at 12:16 pm

    Stylish.. bro.. !!

  • Albert
    November 25, 2011 at 6:55 am

    Your code rocks! Super easy, direct to action and working in 5 minutes!

    Thanks Mahmud!

  • Gys
    January 5, 2012 at 7:19 am

    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 ?

    • Gys
      January 5, 2012 at 7:27 am

      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 ?

      • SHIV
        January 7, 2012 at 3:10 pm

        Hi, Gys, can you tell me exactly what change you made in “website” box in Twitter app?
        because it’s not working for me… :(

  • SHIV
    January 7, 2012 at 1:10 pm

    Twitter status is not updating… :(
    and cannot understand the above Comment which says it’s works fine…

  • Muhammad Asad
    February 7, 2012 at 9:09 pm

    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?


  • surinder
    March 18, 2012 at 4:52 pm

    @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

    i need this script to work .


  • loretta
    May 15, 2012 at 8:50 am

    please i need the application to update for twitter.. am not good at coding can anybody help me : (

  • Jack
    May 24, 2012 at 9:44 am

    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?

  • Raaj Jain
    December 30, 2012 at 7:39 pm

    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.

  • hanung
    March 13, 2013 at 12:42 pm


  • Deki
    March 13, 2013 at 11:20 pm

    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.

  • devipriya
    April 11, 2013 at 10:59 am


    I didnt get the request token for Linkedin..\

    can any one please help me….

  • devipriya
    April 11, 2013 at 11:32 am

    Please any one help me , its very urgent..

Comments are closed here.

About Me

Hi I am Mahmud Ahsan. I Love computer programming and write occasional blog post. In my early career I worked mostly on web based application and since 2011, I exclusively working on iPhone and android applications. I work at home, father of a nice kid and husband of a beautiful wife. [My Business | Twitter | Linkedin]

Twitter Feed