Subscribed unsubscribe Subscribe Subscribe

Kentaro Kuribayashi's blog

Software Engineering, Management, Books, and Daily Journal.

Released hato-plugin-twitter

I just released hato-plugin-twitter.

It's a Hato plugin to send messages via Twitter. It can be useful because you can mange secret info for Twitter API in one place.

Hato::Config.define do
  api_key 'test'
  host    '0.0.0.0'
  port    9699

  # ...

  tag 'test' do
    plugin 'Twitter' do
      consumer_key        'YOUR COMSUMER KEY'
      consumer_secret     'YOUR CONSUMER SECRET'
      access_token        'YOUR ACCESS TOKEN'
      access_token_secret 'YOUR ACCESS TOKEN SECRET'
      message_template    '[<%= args[:tag] %>] <%= args[:message] %>'
    end
  end

  # ...
end