简体   繁体   English

Twitter API,PHP中的链接API

[英]Twitter API, Linked In API in PHP

I am looking for a simple script that I can use to send some text to Twitter, and Linked in. 我正在寻找一个简单的脚本,可以用来向Twitter发送一些文本,然后将其链接。

The objective is to be able to have a simple sample PHP script that looks something like this: 目的是要有一个简单的示例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 anyone help with writing the server side functions that will encapsulate the Twitter and LinkedIn API? 有人帮忙编写封装Twitter和LinkedIn API的服务器端功能吗?

Twitter currently recommends tmhOAuth and we use it. Twitter当前建议使用tmhOAuth ,我们将使用它。 It works well 效果很好

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: 我不确定LinkedIn的工作方式,但是对于Twitter,您必须使用oAuth为用户发布信息,或者仅使用以下格式的链接:

<a href=”http://twitter.com/home?status=STATUS”>Tweet</a>

and then the user just has to post the status on twitter's site. 然后用户只需在Twitter的网站上发布状态即可。

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. 您需要对Twitter使用oAuth,如果这是您的LinkedIn帐户,则可以链接这两个帐户以共享同一提要。 LinkedIn API link http://developer.linkedin.com/community/apis;jsessionid=0386306DE923BEFCB325BD1E9B6F7ABB.node0 Would need to request API Access LinkedIn API链接http://developer.linkedin.com/community/apis;jsessionid=0386306DE923BEFCB325BD1E9B6F7ABB.node0将需要请求API访问

For twitter have a look here for PHP script. 对于Twitter,请在这里查看PHP脚本。 php-twitter PHP-叽叽喳喳

I don't think LinkedIn has a public API but it has an API. 我不认为LinkedIn具有公共API,但是具有API。 You would need to contact them to get that information. 您需要与他们联系以获取该信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM