一个通过鸡蛋扩展的twitter机器人

mrpump的Python项目详细描述


Pump先生是个Twitter机器人,用的是Tweepy。

使用

  1. 安装MR泵。

  2. 在twitter上为pump先生建立一个帐户。

  3. 听泵的话,让他听你的。

  4. 访问dev.twitter.com。以泵用户身份登录。创建新的“应用程序”。

  5. 记住,只有你对你如何使用或滥用Twitter负责。

  6. 获取应用程序的开发人员访问令牌。

  7. 写一个配置文件;我们称之为golem.ini。(见下文。)

  8. 运行MR泵:

    emet golem.ini
    
  9. 向Pump先生发送一条直接消息,例如“19 ping”。

  10. 收到他的回复:“927 Pong.”

信息中的数字是多少?

只是为了避开Twitter的“哇哦,你已经说过了!“消息。它 似乎是为了防止重复发布。但是当你和 你可能需要更多地重复你自己的电脑,而不是与人。

配置文件

[app]
# OAuth info needed to log in. You get these two when you register your app -
key = ABCDEFGHijkl012345MNO
secret = gr0igh24g8h240gh2rvun92rnuEIIH847fhier00

# (this is the screen name of the bot)
[mygolem]
# - and you get these two when you get your developer access token.
token = 284729478-KANEFIIGRVKNRVO3883474KFKEVDKknvdvdkn993
secret = prgiIRGJIGkvmvvnkfkKNKRFNKFIFEIV48347fenef

# A name for the instance of the ping chem -
[ping]
# For the ping chem, use the 'ping' entry point from the 'mrpump' egg.
use = egg:mrpump#ping

# A name for the instance of the time chem -
[time]
# For this one use the 'time' entry point from the 'time_chem' egg
use = egg:time_chem#time
# Any additional config required by this chem
format = Year %Y month %m day %d

[global]
# A colon-separated list of directories wherein eggs containing chems are to be
# found.
plugin path = /home/me/mrpump-plugins
# This is the same as the section name above.
screen name = mygolem
# Name of a file that Mr. Pump can write in. Gets no larger than 10k.
cache = /tmp/already_seen
# How many seconds between checking messages. Don't make Twitter angry.
check every = 60
# debug, info, error: minimum level of messages to display. Debug is quite
# verbose.
log level = info
# Names of each section above that configures a chem.
chems = ping, time

让泵先生做些很酷的事情

写一个化学物,放在鸡蛋里。然后更改配置以包括 然后重启泵先生。普雷斯托,你的新功能已经准备好了!

在examples目录中有一个time-chem。要想成功,就去做吧 目录,然后运行python setup.py bdist_egg。把鸡蛋锉 (dist/*egg)位于配置的plugin path目录中。这个 ^上面示例配置中的{tt4}$部分将加载时间模式。 现在运行emet,并dm您的bot,time

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么@DELETE REST不起作用?   带有JPA2的java表值参数。1和Hibernate,Sql Server   如何将Java类添加到Xamarin VS2017项目   绘制多边形时出现java空指针异常   java Apache WebClient 303状态未重定向   java如何用一组字符串数组从数据库中获取数据   java是否可以使用Google Drive API向文件中添加脚本?   java组织。阿帕奇。贾斯珀。JspC jar文件下载   java在整个JSON映射中将单个值作为JSON流   通过命令行将文件输入到java   java rs.next()总是返回false   java标记异常,通知调用方利用异常消息   java Spring YML数组属性为空