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
 | 
					    # Tweet something every 24 hours
 | 
				
			||||||
    # See https://github.com/jmettraux/rufus-scheduler
 | 
					    # See https://github.com/jmettraux/rufus-scheduler
 | 
				
			||||||
    # bot.tweet("hi")
 | 
					    # bot.tweet("hi")
 | 
				
			||||||
 | 
						# bot.pictweet("hi", "cuteselfie.jpg", ":possibly_sensitive => true")
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								lib/twitter_ebooks/bot.rb
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										6
									
								
								lib/twitter_ebooks/bot.rb
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							| 
						 | 
					@ -164,6 +164,12 @@ module Ebooks
 | 
				
			||||||
      @twitter.update(*args)
 | 
					      @twitter.update(*args)
 | 
				
			||||||
    end
 | 
					    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_startup(&b); @on_startup = b; end
 | 
				
			||||||
    def on_follow(&b); @on_follow = b; end
 | 
					    def on_follow(&b); @on_follow = b; end
 | 
				
			||||||
    def on_mention(&b); @on_mention = b; end
 | 
					    def on_mention(&b); @on_mention = 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
 | 
					    # Tweet something every 24 hours
 | 
				
			||||||
    # See https://github.com/jmettraux/rufus-scheduler
 | 
					    # See https://github.com/jmettraux/rufus-scheduler
 | 
				
			||||||
    # bot.tweet("hi")
 | 
					    # bot.tweet("hi")
 | 
				
			||||||
 | 
					    # bot.pictweet("hi", "cuteselfie.jpg", ":possibly_sensitive => true")
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue