naif / nova-twitter-timeline

一个Laravel Nova卡片,显示最新的用户时间线和提及的推文

v1.0 2018-08-24 20:00 UTC

This package is not auto-updated.

Last update: 2024-09-17 12:58:08 UTC


README

向Nova仪表板添加一个卡片,显示最新的用户时间线和提及的推文

安装

您可以通过composer在使用Nova的Laravel应用程序中安装此包

composer require naif/nova-twitter-timeline

用法

将以下内容添加到app/Providers/NovaServiceProvider.php中

public function card()
{
    return [
        new \Naif\NovaTwitterTimeline\NovaTwitterTimeline(),
    ];
}

创建一个Twitter应用程序,并从https://developer.twitter.com获取您的API密钥

将以下内容添加到您的/config/services.php中

    'nova_twitter_timeline' => [
        'consumer_key' => env('TWITTER_CONSUMER_KEY', ''),
        'consumer_key_secret' => env('TWITTER_CONSUMER_SECRET', ''),
        'access_token' => env('TWITTER_ACCESS_TOKEN', ''),
        'access_token_secret' => env('TWITTER_ACCESS_TOKEN_SECRET', ''),
        'timeline' => env('TWITTER_TIMELINE', ''),
        'tweets_count' => env('TWITTER_TWEETS_COUNT', ''),
    ],

将以下内容添加到您的.env文件中

TWITTER_CONSUMER_KEY=###################################
TWITTER_CONSUMER_SECRET=################################
TWITTER_ACCESS_TOKEN=###################################
TWITTER_ACCESS_TOKEN_SECRET=############################
TWITTER_TIMELINE=mentions_timeline // here you can set what timeline you would like to retrieve (mentions_timeline OR user_timeline)
TWITTER_TWEETS_COUNT=5 // here is the count of tweets you would like to retrieve Max: 200

支持

naif@naif.io

https://www.linkedin.com/in/naif

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件