johnshopkins/twitterhook

此软件包已被 弃用,并且不再维护。未建议替代软件包。

一个PHP库,用于使用单用户登录OAuth身份验证与Twitter API的GET和POST方法交互。由@abraham的twitteroauth改编。

v2.0 2017-11-29 15:49 UTC

This package is auto-updated.

Last update: 2023-02-14 14:33:55 UTC


README

一个PHP库,用于使用单用户登录OAuth身份验证与Twitter的REST API交互。

示例

<?php

include "path/to/vendor/autoload.php";

$consumer = array(
	"key" =>"consumerkey",
	"secret" => "consumersecret"
);

$token = array(
	"key" =>"accesstoken",
	"secret" => "accesstokensecret"
);

$twitterHook = new \TwitterHook\Client($consumer, $token);

$content = $twitterHook->get("statuses/home_timeline");

$tweet = $twitterHook->post("statuses/update", array(
  "status" => "You would not believe how I posted this tweet.",
));