views:

89

answers:

3

I am looking for a simple script that I can use to send some text to Twitter, and Linked in.

The objective is to be able to have a simple sample PHP script that looks something like this:

<html>
  <head>
    <title>Twitter and Linked In API</title>
    <script type="text/javascript" src="jquery.js">
  </head>
  <body>
  <?php $dummy_txt = 'Hello world! from me'; ?>
  <div id="tweet">Tweet</div>
  <div id="sendto_li">Send to Linked In</div>
  $(body).ready(function(){
     $('#tweet').click(function(){
        //post data to server
     });
     $('#sendto_li').click(function(){
        //post data to server
     });
  });
  </body>
</html>

//Server side
<?php
  function tweet(){
  }

  function sendto_linkedin(){
  }
?>

Cabn anyone help with writing the server side functions that will encapsulate the Twitter and LinkedIn API?

A: 

I'm not sure about how LinkedIn works, but for Twitter, either you have to use oAuth to post for the user or just use a link of this format:

<a href=”http://twitter.com/home?status=STATUS”&gt;Tweet&lt;/a&gt;

and then the user just has to post the status on twitter's site.

Tim Lytle
A: 

You need to use oAuth for Twitter and if it's your LinkedIn account you can link the two accounts to share the same feed. LinkedIn API link http://developer.linkedin.com/community/apis;jsessionid=0386306DE923BEFCB325BD1E9B6F7ABB.node0 Would need to request API Access

Phill Pafford
A: 

For twitter have a look here for PHP script. php-twitter

I don't think LinkedIn has a public API but it has an API. You would need to contact them to get that information.

PurplePilot