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&开发者_如何学JAVAgt;
<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?
Twitter currently recommends tmhOAuth and we use it. It works well
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.
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”>Tweet</a>
and then the user just has to post the status on twitter's site.
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
精彩评论