twitter_bot_generator 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c3965a6085ac999b9f55d993f35442a4c5cbdbf
4
- data.tar.gz: c68becc7c37b03eed2ffecf14920ce7f6f8a2fd3
3
+ metadata.gz: 9076237edd5d4ec1cce57947c265ec9183188a17
4
+ data.tar.gz: 6379395417ebf1ef4e80563d57f294b9f074a5cf
5
5
  SHA512:
6
- metadata.gz: 74c1c635dfed8af6d87cd5893cc8c864d543b0d4257503b62a110aa7e1c7ac3129233999f1d427fe419500df8d4d982f40bddf4339cde7be18e82a0a22e695a8
7
- data.tar.gz: caa44e2f4e31b9c313d40b8458d65648467dbf7d1a7fc7c420b1fb0547c0461db307d7860df034a2f26ac002e8a3b5e97dcfbbbeae1ad02a7c4a76d88156a6db
6
+ metadata.gz: c0539d695463e9ff9abbe150046ebd1a837e5aa7eb90603761df51fa09ebe750125c85057386c4181cd274675604e3a8af7b88435b238a95d8c358b880d9b341
7
+ data.tar.gz: 81582d43792f394c72b9ed1f9bafc6f28e05ed3194a8cd175115ee26867c854529535244c5b0d32ece5345aa02691dd3999c05e49394c43c039b9ef522f29ed0
data/README.md CHANGED
@@ -1,10 +1,6 @@
1
1
  # twitter_bot_generator
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/twitter_bot_generator.svg)](http://badge.fury.io/rb/twitter_bot_generator)
4
-
5
- [![Build Status](https://travis-ci.org/coleww/twitter_bot_generator.svg?branch=master)](https://travis-ci.org/coleww/twitter_bot_generator)
6
-
7
- [![Coverage Status](https://coveralls.io/repos/coleww/twitter_bot_generator/badge.png?branch=master)](https://coveralls.io/r/coleww/twitter_bot_generator?branch=master)
3
+ [![Gem Version](https://badge.fury.io/rb/twitter_bot_generator.svg)](http://badge.fury.io/rb/twitter_bot_generator) [![Build Status](https://travis-ci.org/coleww/twitter_bot_generator.svg?branch=master)](https://travis-ci.org/coleww/twitter_bot_generator) [![Coverage Status](https://coveralls.io/repos/coleww/twitter_bot_generator/badge.png?branch=master)](https://coveralls.io/r/coleww/twitter_bot_generator?branch=master)
8
4
 
9
5
  #### I GENERATE TWITTER BOTS! RUBY IS JOY!
10
6
 
@@ -15,12 +11,24 @@
15
11
 
16
12
  ## Usage
17
13
 
14
+ get --help
15
+
18
16
  ```
19
17
  $ twitter_bot_generator --help
20
- twitter_bot_generator <yr_bots_name_camel_cased>
18
+ twitter_bot_generator <yr_bots_name_camel_cased> (--<OPTIONAL OPTION>)
21
19
  ## creates a new directory called <yr_bots_name_camel_cased> in the current working directory,
22
20
  and fills it with a bunch of boilerplate goodness
21
+ for building a bot that says stuff at a semi-random interval
22
+ OPTIONAL ALTERNATIVE OPTIONS:
23
+ --streaming || -S: generates a bot that listens to the "gardenhose"
24
+ --userstream || -U: generates a bot that listens for tweets @ it
25
+ have fun be kind to each other thanks goodbye!
26
+ ```
27
+
23
28
 
29
+ make a bot
30
+
31
+ ```
24
32
  $ twitter_bot_generator wat_fun
25
33
  scaffolding a twitter bot that is named wat_fun!
26
34
  mkdir wat_fun/
@@ -50,6 +58,12 @@ HAVE FUN BE SAFE PLAY NICE
50
58
 
51
59
  Make a PR against this repo to add yrs!
52
60
 
61
+ [NPM generator](https://github.com/coleww/npm-bot-dude) invents new uses/meanings for NPM
62
+
63
+ [Hot New Superpowers!](https://github.com/coleww/power_bot) invents new super powers through markov magic
64
+
65
+ [FriendFeld](https://github.com/coleww/friendfeld) mashes up friends and seinfeld episode titles
66
+
53
67
  [dada bot](https://github.com/coleww/dadabot) tweets simple things related to dadaism
54
68
 
55
69
  [MiniTest::Warner](https://github.com/coleww/mini_test_warner_bot) tweets more complex phrases, it makes up fake deprecation warnings
@@ -65,6 +65,7 @@ class TwitterBotGenerator
65
65
  {
66
66
  'bot.rb' => (render_code 'bot.rb', varz),
67
67
  '.gitignore' => (render_code '.gitignore', varz),
68
+ '.travis.yml' => (render_code '.travis.yml', varz),
68
69
  'Gemfile' => (render_code 'Gemfile', varz),
69
70
  'README.md' => (render_code 'README.md', varz),
70
71
  'Procfile' => (render_code 'Procfile', varz),
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+
7
+ script: 'bundle exec ruby test.rb'
@@ -1,46 +1,25 @@
1
1
  # <%= bot_name %>
2
+
2
3
  A Twitter Bot
3
4
 
4
5
  ## Development
5
6
 
6
- > bundle install
7
- > ruby test.rb
8
- > ruby spec.rb
7
+ ```
8
+ bundle install
9
+ ruby test.rb
10
+ ruby spec.rb
11
+ ```
9
12
 
10
13
  ## Deployment (heroku)
11
14
 
12
- Once your bot has been well tested on the command line you'll need to get it out into the world!
13
-
14
- * You probably need git and the heroku toolbet installed and also a heroku account.
15
- * Make a twitter account for your bot. Give it a photo and header and some biographical information
16
- * Go into settings > mobile and add a cell phone number that you can send a text from.
17
- not all carriers will work :(
18
- without a mobile number, twitter won't let you get the api keys you need to deploy
19
- if your mobile number is associated with your personal account, temporarily delete it from that account so you can use it for your bot. Twitter doesn't care.
20
- * go to apps.twitter.com and sign in again
21
- * click create a new app
22
- * fill in the details. just put down the github repo link or twitter page for the bot as website/callback url. no one will ever see this except you.
23
- * once your app is created, click "modify app permissions" and set the app to read and write
24
- * wait a lil bit for permissions to change.......
25
- * click 'generate my access token'
26
- * wait a lil bit to get access tokens.....
27
- * SUCCESS! copy the access tokens down to a scratch txt file, but make sure not to commit it to source control/git/etc.! That would be bad because these things are secrets.
28
- * From the command line:
29
-
30
15
  ```
31
16
  heroku create
32
17
  heroku config:set TWITTER_CONSUMER_KEY=INSERT-YR-SECRETS-HERE
33
18
  heroku config:set TWITTER_CONSUMER_SECRET=INSERT-YR-SECRETS-HERE
34
19
  heroku config:set TWITTER_ACCESS_TOKEN=INSERT-YR-SECRETS-HERE
35
20
  heroku config:set TWITTER_ACCESS_SECRET=INSERT-YR-SECRETS-HERE
36
- ```
37
-
38
- * go back to twitter.com and delete yr mobile phone from the bot account. you may also want to disable email notifications as well.
39
- * THE MAIN EVENT:
40
-
41
- ```
42
21
  git push heroku master
43
22
  heroku ps:scale bot=1
44
23
  ```
45
24
 
46
- * go to your bot's page and you should see it's first tweet! Or something?
25
+ For more help with deployment, check out the [twitter bot tutorial](https://github.com/coleww/twitter-art-bot-tutorial/blob/master/lessons/heroku_deploy.md)
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/<%= bot_name %>.rb'
5
5
 
6
- class Test<%= class_name %> < MiniTest::Test
6
+ class Test<%= class_name %> < Minitest::Test
7
7
 
8
8
  def test_matches_hello_world
9
9
  assert_equal true, (<%= class_name %>.matches? 'hello world')
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/<%= bot_name %>.rb'
5
5
 
6
- class Test<%= class_name %> < MiniTest::Test
6
+ class Test<%= class_name %> < Minitest::Test
7
7
 
8
8
  def test_generate_returns_hello_world
9
9
  assert_match /Hello/, <%= class_name %>.generate
@@ -18,9 +18,4 @@ class Test<%= class_name %> < MiniTest::Test
18
18
  assert_instance_of String, <%= class_name %>.send(:greetings)[0]
19
19
  end
20
20
 
21
- def test_hides_io_metal
22
- refute_respond_to <%= class_name %>, :load_txt_file
23
- assert_equal 3, <%= class_name %>.send(:load_txt_file, 'greetings.txt').length
24
- end
25
-
26
21
  end
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/<%= bot_name %>.rb'
5
5
 
6
- class Test<%= class_name %> < MiniTest::Test
6
+ class Test<%= class_name %> < Minitest::Test
7
7
 
8
8
  def test_reverses_hello_world
9
9
  assert_match (<%= class_name %>.respond_to 'hello world'), 'dlrow olleh'
@@ -1,4 +1,4 @@
1
1
  class TwitterBotGenerator
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
4
4
 
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+
7
+ script: 'bundle exec ruby test.rb'
@@ -1,46 +1,25 @@
1
1
  # such_streaming_bot
2
+
2
3
  A Twitter Bot
3
4
 
4
5
  ## Development
5
6
 
6
- > bundle install
7
- > ruby test.rb
8
- > ruby spec.rb
7
+ ```
8
+ bundle install
9
+ ruby test.rb
10
+ ruby spec.rb
11
+ ```
9
12
 
10
13
  ## Deployment (heroku)
11
14
 
12
- Once your bot has been well tested on the command line you'll need to get it out into the world!
13
-
14
- * You probably need git and the heroku toolbet installed and also a heroku account.
15
- * Make a twitter account for your bot. Give it a photo and header and some biographical information
16
- * Go into settings > mobile and add a cell phone number that you can send a text from.
17
- not all carriers will work :(
18
- without a mobile number, twitter won't let you get the api keys you need to deploy
19
- if your mobile number is associated with your personal account, temporarily delete it from that account so you can use it for your bot. Twitter doesn't care.
20
- * go to apps.twitter.com and sign in again
21
- * click create a new app
22
- * fill in the details. just put down the github repo link or twitter page for the bot as website/callback url. no one will ever see this except you.
23
- * once your app is created, click "modify app permissions" and set the app to read and write
24
- * wait a lil bit for permissions to change.......
25
- * click 'generate my access token'
26
- * wait a lil bit to get access tokens.....
27
- * SUCCESS! copy the access tokens down to a scratch txt file, but make sure not to commit it to source control/git/etc.! That would be bad because these things are secrets.
28
- * From the command line:
29
-
30
15
  ```
31
16
  heroku create
32
17
  heroku config:set TWITTER_CONSUMER_KEY=INSERT-YR-SECRETS-HERE
33
18
  heroku config:set TWITTER_CONSUMER_SECRET=INSERT-YR-SECRETS-HERE
34
19
  heroku config:set TWITTER_ACCESS_TOKEN=INSERT-YR-SECRETS-HERE
35
20
  heroku config:set TWITTER_ACCESS_SECRET=INSERT-YR-SECRETS-HERE
36
- ```
37
-
38
- * go back to twitter.com and delete yr mobile phone from the bot account. you may also want to disable email notifications as well.
39
- * THE MAIN EVENT:
40
-
41
- ```
42
21
  git push heroku master
43
22
  heroku ps:scale bot=1
44
23
  ```
45
24
 
46
- * go to your bot's page and you should see it's first tweet! Or something?
25
+ For more help with deployment, check out the [twitter bot tutorial](https://github.com/coleww/twitter-art-bot-tutorial/blob/master/lessons/heroku_deploy.md)
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/such_streaming_bot.rb'
5
5
 
6
- class TestSuchStreamingBot < MiniTest::Test
6
+ class TestSuchStreamingBot < Minitest::Test
7
7
 
8
8
  def test_matches_hello_world
9
9
  assert_equal true, (SuchStreamingBot.matches? 'hello world')
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+
7
+ script: 'bundle exec ruby test.rb'
@@ -1,46 +1,25 @@
1
1
  # such_test_bot
2
+
2
3
  A Twitter Bot
3
4
 
4
5
  ## Development
5
6
 
6
- > bundle install
7
- > ruby test.rb
8
- > ruby spec.rb
7
+ ```
8
+ bundle install
9
+ ruby test.rb
10
+ ruby spec.rb
11
+ ```
9
12
 
10
13
  ## Deployment (heroku)
11
14
 
12
- Once your bot has been well tested on the command line you'll need to get it out into the world!
13
-
14
- * You probably need git and the heroku toolbet installed and also a heroku account.
15
- * Make a twitter account for your bot. Give it a photo and header and some biographical information
16
- * Go into settings > mobile and add a cell phone number that you can send a text from.
17
- not all carriers will work :(
18
- without a mobile number, twitter won't let you get the api keys you need to deploy
19
- if your mobile number is associated with your personal account, temporarily delete it from that account so you can use it for your bot. Twitter doesn't care.
20
- * go to apps.twitter.com and sign in again
21
- * click create a new app
22
- * fill in the details. just put down the github repo link or twitter page for the bot as website/callback url. no one will ever see this except you.
23
- * once your app is created, click "modify app permissions" and set the app to read and write
24
- * wait a lil bit for permissions to change.......
25
- * click 'generate my access token'
26
- * wait a lil bit to get access tokens.....
27
- * SUCCESS! copy the access tokens down to a scratch txt file, but make sure not to commit it to source control/git/etc.! That would be bad because these things are secrets.
28
- * From the command line:
29
-
30
15
  ```
31
16
  heroku create
32
17
  heroku config:set TWITTER_CONSUMER_KEY=INSERT-YR-SECRETS-HERE
33
18
  heroku config:set TWITTER_CONSUMER_SECRET=INSERT-YR-SECRETS-HERE
34
19
  heroku config:set TWITTER_ACCESS_TOKEN=INSERT-YR-SECRETS-HERE
35
20
  heroku config:set TWITTER_ACCESS_SECRET=INSERT-YR-SECRETS-HERE
36
- ```
37
-
38
- * go back to twitter.com and delete yr mobile phone from the bot account. you may also want to disable email notifications as well.
39
- * THE MAIN EVENT:
40
-
41
- ```
42
21
  git push heroku master
43
22
  heroku ps:scale bot=1
44
23
  ```
45
24
 
46
- * go to your bot's page and you should see it's first tweet! Or something?
25
+ For more help with deployment, check out the [twitter bot tutorial](https://github.com/coleww/twitter-art-bot-tutorial/blob/master/lessons/heroku_deploy.md)
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/such_test_bot.rb'
5
5
 
6
- class TestSuchTestBot < MiniTest::Test
6
+ class TestSuchTestBot < Minitest::Test
7
7
 
8
8
  def test_generate_returns_hello_world
9
9
  assert_match /Hello/, SuchTestBot.generate
@@ -18,9 +18,4 @@ class TestSuchTestBot < MiniTest::Test
18
18
  assert_instance_of String, SuchTestBot.send(:greetings)[0]
19
19
  end
20
20
 
21
- def test_hides_io_metal
22
- refute_respond_to SuchTestBot, :load_txt_file
23
- assert_equal 3, SuchTestBot.send(:load_txt_file, 'greetings.txt').length
24
- end
25
-
26
21
  end
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+
7
+ script: 'bundle exec ruby test.rb'
@@ -1,46 +1,25 @@
1
1
  # such_userstream_bot
2
+
2
3
  A Twitter Bot
3
4
 
4
5
  ## Development
5
6
 
6
- > bundle install
7
- > ruby test.rb
8
- > ruby spec.rb
7
+ ```
8
+ bundle install
9
+ ruby test.rb
10
+ ruby spec.rb
11
+ ```
9
12
 
10
13
  ## Deployment (heroku)
11
14
 
12
- Once your bot has been well tested on the command line you'll need to get it out into the world!
13
-
14
- * You probably need git and the heroku toolbet installed and also a heroku account.
15
- * Make a twitter account for your bot. Give it a photo and header and some biographical information
16
- * Go into settings > mobile and add a cell phone number that you can send a text from.
17
- not all carriers will work :(
18
- without a mobile number, twitter won't let you get the api keys you need to deploy
19
- if your mobile number is associated with your personal account, temporarily delete it from that account so you can use it for your bot. Twitter doesn't care.
20
- * go to apps.twitter.com and sign in again
21
- * click create a new app
22
- * fill in the details. just put down the github repo link or twitter page for the bot as website/callback url. no one will ever see this except you.
23
- * once your app is created, click "modify app permissions" and set the app to read and write
24
- * wait a lil bit for permissions to change.......
25
- * click 'generate my access token'
26
- * wait a lil bit to get access tokens.....
27
- * SUCCESS! copy the access tokens down to a scratch txt file, but make sure not to commit it to source control/git/etc.! That would be bad because these things are secrets.
28
- * From the command line:
29
-
30
15
  ```
31
16
  heroku create
32
17
  heroku config:set TWITTER_CONSUMER_KEY=INSERT-YR-SECRETS-HERE
33
18
  heroku config:set TWITTER_CONSUMER_SECRET=INSERT-YR-SECRETS-HERE
34
19
  heroku config:set TWITTER_ACCESS_TOKEN=INSERT-YR-SECRETS-HERE
35
20
  heroku config:set TWITTER_ACCESS_SECRET=INSERT-YR-SECRETS-HERE
36
- ```
37
-
38
- * go back to twitter.com and delete yr mobile phone from the bot account. you may also want to disable email notifications as well.
39
- * THE MAIN EVENT:
40
-
41
- ```
42
21
  git push heroku master
43
22
  heroku ps:scale bot=1
44
23
  ```
45
24
 
46
- * go to your bot's page and you should see it's first tweet! Or something?
25
+ For more help with deployment, check out the [twitter bot tutorial](https://github.com/coleww/twitter-art-bot-tutorial/blob/master/lessons/heroku_deploy.md)
@@ -3,7 +3,7 @@ require 'minitest/pride'
3
3
 
4
4
  require_relative '../src/such_userstream_bot.rb'
5
5
 
6
- class TestSuchUserstreamBot < MiniTest::Test
6
+ class TestSuchUserstreamBot < Minitest::Test
7
7
 
8
8
  def test_reverses_hello_world
9
9
  assert_match (SuchUserstreamBot.respond_to 'hello world'), 'dlrow olleh'
@@ -29,6 +29,12 @@ class TestTwitterBotGenerator < MiniTest::Test
29
29
  assert_match /SuchTestBot.generate/, (File.read './such_test_bot/bot.rb')
30
30
  end
31
31
 
32
+ def test_it_creates_a_travis_for_lulz
33
+ assert_equal true, (File.exists? './such_test_bot/.travis.yml')
34
+ assert_match /bundle exec ruby test/, (File.read './such_test_bot/.travis.yml')
35
+ assert_match /2\.0\.0/, (File.read './such_test_bot/.travis.yml')
36
+ end
37
+
32
38
  def test_it_creates_a_gitignore
33
39
  assert_equal true, (File.exists? './such_test_bot/.gitignore')
34
40
  assert_match /.DS_Store/, (File.read './such_test_bot/.gitignore')
@@ -42,7 +48,7 @@ class TestTwitterBotGenerator < MiniTest::Test
42
48
 
43
49
  def test_it_creates_a_readme
44
50
  assert_equal true, (File.exists? './such_test_bot/README.md')
45
- assert_match /\# such_test_bot\nA Twitter Bot/, (File.read './such_test_bot/README.md')
51
+ assert_match /\# such_test_bot\n\nA Twitter Bot/, (File.read './such_test_bot/README.md')
46
52
  end
47
53
 
48
54
  def test_it_creates_a_procfile
@@ -15,7 +15,8 @@ def wipe_such_test_bot! type='test'
15
15
  "./such_#{type}_bot/test/such_#{type}_bot_test.rb",
16
16
  "./such_#{type}_bot/lib/greetings.txt",
17
17
  "./such_#{type}_bot/src/such_#{type}_bot.rb",
18
- "./such_#{type}_bot/.gitignore"].each { |file| File.unlink file if File.exists? file }
18
+ "./such_#{type}_bot/.gitignore",
19
+ "./such_#{type}_bot/.travis.yml"].each { |file| File.unlink file if File.exists? file }
19
20
 
20
21
  ["./such_#{type}_bot/lib",
21
22
  "./such_#{type}_bot/src",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_bot_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cole Willsea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,6 +113,7 @@ files:
113
113
  - bin/twitter_bot_generator
114
114
  - lib/twitter_bot_generator.rb
115
115
  - lib/twitter_bot_generator/templates/.gitignore.erb
116
+ - lib/twitter_bot_generator/templates/.travis.yml.erb
116
117
  - lib/twitter_bot_generator/templates/Gemfile.erb
117
118
  - lib/twitter_bot_generator/templates/Procfile.erb
118
119
  - lib/twitter_bot_generator/templates/README.md.erb
@@ -132,6 +133,7 @@ files:
132
133
  - lib/twitter_bot_generator/templates/userstream-spec.rb.erb
133
134
  - lib/twitter_bot_generator/version.rb
134
135
  - such_streaming_bot/.gitignore
136
+ - such_streaming_bot/.travis.yml
135
137
  - such_streaming_bot/Gemfile
136
138
  - such_streaming_bot/Procfile
137
139
  - such_streaming_bot/README.md
@@ -142,6 +144,7 @@ files:
142
144
  - such_streaming_bot/test.rb
143
145
  - such_streaming_bot/test/such_streaming_bot_test.rb
144
146
  - such_test_bot/.gitignore
147
+ - such_test_bot/.travis.yml
145
148
  - such_test_bot/Gemfile
146
149
  - such_test_bot/Procfile
147
150
  - such_test_bot/README.md
@@ -152,6 +155,7 @@ files:
152
155
  - such_test_bot/test.rb
153
156
  - such_test_bot/test/such_test_bot_test.rb
154
157
  - such_userstream_bot/.gitignore
158
+ - such_userstream_bot/.travis.yml
155
159
  - such_userstream_bot/Gemfile
156
160
  - such_userstream_bot/Procfile
157
161
  - such_userstream_bot/README.md