justincdotme/tweetme

该包最新版本(1.0.14)没有可用的许可信息。

一个简单的Laravel 5 Twitter消息包。

1.0.14 2017-02-11 04:21 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:28:58 UTC


README

一个简单的Laravel和Lumen 5.* Twitter消息包。TweetMe返回用户Twitter消息历史中的精简Tweets集合。

要求

Laravel 5.*
Lumen 5.*

Lumen 5.* 安装

使用Composer安装该包

composer require justincdotme/tweetme

您可以选择通过取消以下bootstrap/app.php中的注释来启用Facades

$app->withFacades();

通过在bootstrap/app.php中添加以下内容来注册Service Provider

$app->register(Justincdotme\TweetMe\TweetServiceProvider::class);

Laravel 5.* 安装

composer require justincdotme/tweetme

php artisan vendor:publish
将TweetServiceProvider添加到app/config.php中的providers数组
'providers' => [
    ...
    Justincdotme\TweetMe\TweetServiceProvider::class,
    ...
]
将OAuth令牌和密钥添加到.env文件
OAUTH_CONSUMER_KEY=""
OAUTH_ACCESS_TOKEN=""
OAUTH_CONSUMER_SECRET=""
OAUTH_ACCESS_TOKEN_SECRET=""

用法

The TweetMe class exposes one method, getTweets(), which returns a collection.
Feel free to use the Facade or inject the TweetMeInterface.
Usage Examples: 

$tweetArray = TweetMe::getTweets()->toArray();

OR

$jsonResponse = TweetMe::getTweets()->toJson();

待办事项

  • 实现Guzzle HTTP库
  • 用Guzzle OAuth实现替换OAuth