alexislefebvre / async-tweets-bundle
Symfony 扩展包,提供异步读取 Twitter 的功能
0.11.0
2020-07-11 21:45 UTC
Requires
- php: >=7.2
- ext-mbstring: *
- abraham/twitteroauth: ~0.6
- doctrine/orm: ^2.4.8
- symfony/config: ^3.4|^4.4
- symfony/form: ^3.4|^4.4
- symfony/framework-bundle: ^3.4|^4.4
- symfony/security-csrf: ^3.4|^4.4
- symfony/templating: ^3.4|^4.4
- symfony/twig-bundle: ^3.4|^4.4
- symfony/var-dumper: ^3.4|^4.4
Requires (Dev)
- behat/behat: ~3.2
- behat/mink: ^1.7
- behat/mink-browserkit-driver: ~1.3
- behat/mink-extension: ~2.2
- behat/symfony2-extension: ^2.1
- behatch/contexts: ^3.1
- doctrine/data-fixtures: ^1.3
- doctrine/doctrine-fixtures-bundle: ^3.0
- liip/functional-test-bundle: ^4.0.0
- liip/test-fixtures-bundle: ^1.0.0
- nelmio/alice: ^3.4
- phpspec/phpspec: ~4.2||~5.0||^6.2
- phpstan/phpstan-doctrine: ^0.12.17
- phpunit/phpunit: ~7.5.12|~8.1.6
- symfony/monolog-bundle: ~3.1
README
A Symfony 扩展包,提供异步读取 Twitter 的功能
链接
- 演示: https://asynctweets.alexislefebvre.com/demo/
- 代码覆盖率: https://asynctweets.alexislefebvre.com/codecoverage/
- Doxygen: https://asynctweets.alexislefebvre.com/doxygen/
- ApiGen: https://asynctweets.alexislefebvre.com/apigen/
目标
本项目的目标是创建一个使用 Symfony 构建的在线Twitter阅读器,AsyncTweets可以检索并存储您的推文时间线,即使您几天没有使用Twitter客户端,也可以阅读您的Twitter时间线。
此捆绑包还用于测试多个CI(持续集成)服务。
功能
- 使用用户的Twitter密钥检索推文
- 使用分页显示推文
- 在推文下方显示图片
安装
要求
步骤
-
使用Composer安装此捆绑包:
composer require alexislefebvre/async-tweets-bundle
-
在 app/AppKernel.php 中添加捆绑包
<?php public function registerBundles() { $bundles = array( // ... new AlexisLefebvre\Bundle\AsyncTweetsBundle\AsyncTweetsBundle(), ); }
-
在 app/config/parameters.yml 文件的末尾输入您的Twitter密钥
twitter_consumer_key: null twitter_consumer_secret: null twitter_token: null twitter_token_secret: null
-
创建数据库并创建表:
php app/console doctrine:schema:update --force --env=prod
用法
-
启动以下命令以获取推文:
php app/console statuses:hometimeline --table --env=prod
,带有--table
选项,将显示导入的推文 -
将路由导入到您的 app/config/routing.yml
asynctweets_website: resource: "@AsyncTweetsBundle/Resources/config/routing.yml" prefix: /asynctweets # Use only "/" if you want AsyncTweets at the root of the website
-
使用浏览器打开页面
.../YOUR_DIRECTORY/web/asynctweets/
或使用以下命令php app/console statuses:read --env=prod
查看推文 -
将
php app/console statuses:hometimeline --env=prod
添加到您的crontab中(例如每小时一次)以自动检索推文
依赖关系
- symfony/symfony (3.4+)
- abraham/twitteroauth (^0.6.0)
- twitter/bootstrap(使用 Bootswatch 3.3.2)
测试
make tests
质量保证
make qa