Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taiki45/bot_nyan
Bot_nyan is quickly creating twitter-bot in Ruby with Sinatra like DSL
https://github.com/taiki45/bot_nyan
Last synced: 13 days ago
JSON representation
Bot_nyan is quickly creating twitter-bot in Ruby with Sinatra like DSL
- Host: GitHub
- URL: https://github.com/taiki45/bot_nyan
- Owner: taiki45
- License: mit
- Created: 2012-09-23T14:36:50.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-16T16:07:56.000Z (almost 12 years ago)
- Last Synced: 2024-03-15T06:24:52.834Z (8 months ago)
- Language: Ruby
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# About
Bot_nyan is simple twitter-bot-framework with DSL like Sinatra.
## Installation
Add this line to your application's Gemfile:
gem 'bot_nyan'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bot_nyan
Or clone and build yourself:
$ git clone git://github.com/taiki45/bot_nyan.git && cd bot_nyan
$ gem build bot_nyan.gemspec
$ rake install
## Usage
Simple echo and say-hello Bot.
```ruby
# bot.rb
# -*- encoding: utf-8 -*-
require 'bot_nyan'set :consumer_key, {:key => 'XXXXXX',
:secret => 'XXXXXX'}
set :access_token, {:token => 'XXXXXX',
:secret => 'XXXXXX'}
set :name, 'my_bot_name'on_matched_reply /^@my_bot_name\s(Hello)/u do
reply "@#{user.screen_name} Hello!"
endon_replied do
reply "@#{user.screen_name} #{status.text.slice(/^@my_bot_name\s(.*)/u, 1)}"
end
```And Simply do it.
```
$ ruby bot.rb
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request