cbastienbaron/twitter-bot-net

此包已弃用且不再维护。未建议替代包。


README

这是一个twitter机器人搜索竞赛类型的 rt to #win转发并赢转发有机会赢,赢取酷炫物品...

特性

  • 扫描竞赛推文
  • 转发以参与竞赛
  • 如果需要,关注这些人
  • 向这个人表示感谢(随机字符串)并在回复中添加GIF

安装

从头开始

git clone git@github.com:cbastienbaron/twitter-bot-net.git \
&& cd twitter-bot-net \
&& composer install  

使用composer (https://getcomposer.org/)

composer create-project cbastienbaron/twitter-bot-net

使用树莓派/docker(本仓库中包含Dockerfile,方便懒人 :) (https://get.docker.com/)

docker build -t cbastien/bot-farm .
docker run -it -d -v $(pwd)/var/data/:/app/var/data --name bot-contest cbastien/bot-farm bin/console bot:contest

配置

cat .env
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com.cn/doc/current/best_practices/configuration.html#infrastructure-related-configuration
TWITTER_CONSUMER_KEY=******
TWITTER_CONSUMER_SECRET=******
TWITTER_TOKEN=******
TWITTER_TOKEN_SECRET=******

GIPHY_API_KEY=SMAU6qz8l1aIxU980R5irqDMTh5hMqR5

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://"
MAILER_URL=null://
MAILER_TO=replace+botnet@gmail.com
MAILER_FROM=replace+botnet@gmail.com
###< symfony/swiftmailer-bundle ###

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=bee0463b64a5bc78bca052ed792902a1
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ###

创建twitter应用账号: https://developer.twitter.com/apps/ 并填写 .env 变量 var GIPHY_API_KEY 测试目的下保持原样

运行

bin/console bot:contest

友善运行