Skip to main content

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

项目描述

Pump 先生是一个 twitter 机器人,使用 tweepy。

使用

  1. 安装泵先生。

  2. 在 Twitter 上为 Pump 先生设置一个帐户。

  3. 关注 Pump 的账号,让他关注你的账号。

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

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

  6. 为您的应用获取开发者访问令牌。

  7. 编写配置文件;我们将其命名为 golem.ini。(见下文。)

  8. 运行泵先生:

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

  10. 收到他的回复:“927 乒乓”。

消息中的数字是多少?

只是一种绕过 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

术语

< http://en.wikipedia.org/wiki/Golems_(Discworld) >

让泵先生做一些很酷的事情

写一个化学药品,把它放在一个鸡蛋里。然后更改您的配置以包含它,然后重新启动 Pump 先生。Presto,您的新功能已准备就绪!

在示例目录中有一个时间化学。要使其工作,请进入该目录,然后运行​​python setup.py bdist_egg。将 egg 文件 ( dist/*egg ) 放在配置的插件路径上的目录中。上面示例配置中的 [time]部分将加载时间化学。现在运行emet,然后 DM 你的机器人time

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

mrpump-0.2.tar.gz (6.4 kB 查看哈希

已上传 source

内置分布

mrpump-0.2-py2.7.egg (13.9 kB 查看哈希

已上传 2 7