Project

lita-tweet

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Tweeting for Lita
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12

Runtime

>= 4.7
~> 0.5.1
~> 5.16
 Project Readme

lita-tweet

Build Status Coverage Status

Allows the Lita chat bot to tweet on command.

Installation

Add lita-tweet to your Lita instance's Gemfile:

gem "lita-tweet"

Configuration

To make this plugin work, you'll need to set at least TWITTER\_CONSUMER\_KEY and TWITTER\_CONSUMER\_SECRET. If you want to host the bot at a specific URL, rather than the default 0.0.0.0:1234 type address, you'll also need to set SERVER\_URL so that the bot knows where to send users and Twitter auth callbacks.

require "lita-tweet" if ENV.has_key?("TWITTER_CONSUMER_KEY")

Lita.configure do |config|
  if ENV.has_key?("TWITTER_CONSUMER_KEY")
    config.handlers.tweet.http_url = ENV["SERVER_URL"]
    config.handlers.tweet.consumer_key = ENV.fetch("TWITTER_CONSUMER_KEY")
    config.handlers.tweet.consumer_secret = ENV.fetch("TWITTER_CONSUMER_SECRET")
  end
end

Usage

To authorize an account for tweeting, use the command twitter accounts add and follow the instructions. To tweet, use the command tweet some text that should go in the tweet. To delete the last tweet, use the command untweet. For a complete list of commands, including how to map specific twitter accounts to specific chat channels, see the output from the command help.