picture shortcut
This commit is contained in:
parent
a2b374f48c
commit
3706ae0bbb
3 changed files with 8 additions and 0 deletions
|
@ -50,6 +50,7 @@ Ebooks::Bot.new("abby_ebooks") do |bot|
|
|||
# Tweet something every 24 hours
|
||||
# See https://github.com/jmettraux/rufus-scheduler
|
||||
# bot.tweet("hi")
|
||||
# bot.pictweet("hi", "cuteselfie.jpg", ":possibly_sensitive => true")
|
||||
end
|
||||
end
|
||||
```
|
||||
|
|
6
lib/twitter_ebooks/bot.rb
Normal file → Executable file
6
lib/twitter_ebooks/bot.rb
Normal file → Executable file
|
@ -163,6 +163,12 @@ module Ebooks
|
|||
log "Tweeting #{args.inspect}"
|
||||
@twitter.update(*args)
|
||||
end
|
||||
|
||||
# could easily just be *args however the separation keeps it clean.
|
||||
def pictweet(txt, pic, *args)
|
||||
log "Tweeting #{txt.inspect} - #{pic} #{args}"
|
||||
@twitter.update_with_media(txt, File.new(pic), *args)
|
||||
end
|
||||
|
||||
def on_startup(&b); @on_startup = b; end
|
||||
def on_follow(&b); @on_follow = b; end
|
||||
|
|
1
skeleton/bots.rb
Normal file → Executable file
1
skeleton/bots.rb
Normal file → Executable file
|
@ -37,5 +37,6 @@ Ebooks::Bot.new("{{BOT_NAME}}") do |bot|
|
|||
# Tweet something every 24 hours
|
||||
# See https://github.com/jmettraux/rufus-scheduler
|
||||
# bot.tweet("hi")
|
||||
# bot.pictweet("hi", "cuteselfie.jpg", ":possibly_sensitive => true")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue