Twitter API、PHP 中的链接 API
我正在寻找一个简单的脚本,可以用来向 Twitter 发送一些文本并链接。
目标是能够有一个简单的示例 PHP 脚本,如下所示:
<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 任何人都可以帮助编写服务器端函数它将封装 Twitter 和 LinkedIn API?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Twitter 目前推荐 tmhOAuth 并且我们使用它。效果很好
Twitter currently recommends tmhOAuth and we use it. It works well
对于 Twitter,请查看此处的 PHP 脚本。 php-twitter
我不认为 LinkedIn 有公共 API,但它有一个 API。您需要联系他们才能获取该信息。
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.
我不确定 LinkedIn 是如何工作的,但对于 Twitter,要么您必须使用 oAuth 为用户发帖,要么只使用这种格式的链接:
然后用户只需在 Twitter 的网站上发布状态。
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:
and then the user just has to post the status on twitter's site.
您需要对 Twitter 使用 oAuth,如果它是您的 LinkedIn 帐户,您可以链接这两个帐户以共享相同的源。 LinkedIn API 链接 http://developer.linkedin.com/community/apis;jsessionid= 0386306DE923BEFCB325BD1E9B6F7ABB.node0 需要请求API访问
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