twuckoo 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009-2010 Balint Erdi (balint.erdi@gmail.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown CHANGED
@@ -7,15 +7,15 @@ Need to tweet periodically and in an automated fashion? Then Twuckoo is for you.
7
7
  Twuckoo fulfills the task of periodically fetching a message and tweeting it (Twuckoo = Twitter + Cuckoo). Since we all prefer code to words, I'll show you its main loop:
8
8
 
9
9
  def run
10
- setup
11
- load_tweets
12
- loop do
13
- tweeted = tweet
14
- quit if tweeted.nil?
15
- relax
10
+ ...
11
+ while next_tweet do
12
+ tweet(next_tweet)
13
+ wait if wait_between_tweets?
14
+ next_tweet = self.next
15
+ notify if next_tweet.nil?
16
16
  end
17
17
  end
18
-
18
+
19
19
  It is very simple in its design but opens vast possibilities due to its modular approach.
20
20
 
21
21
  ## A simple API
@@ -36,19 +36,19 @@ Hands the last tweeted message to be stored. In the case of the one\_line\_from_
36
36
 
37
37
  Twuckoo needs to be passed the name of the module to be used. At the moment there are two provided modules:
38
38
 
39
- * one\_line\_from\_file
39
+ * file
40
40
 
41
41
  Loads all the lines from a file (lines.txt) and tweets one line randomly each time.
42
42
 
43
43
  * wikipedia_tfa
44
44
 
45
- Scraps Wikipedia's main page and extracts the name and link of Today's Featured Article. This is not as general a module as one\_line\_from_file. I am thinking about how to best make a "web" module out of this.
45
+ Scraps Wikipedia's main page and extracts the name and link of Today's Featured Article. This is not as general a module as `file`. I am thinking about how to best make a "web" module out of this.
46
46
 
47
47
  ## Installation
48
48
 
49
- gem install balinterdi-twuckoo --source http://gems.github.com
49
+ gem install twuckoo --source http://gemcutter.org
50
50
 
51
- Twuckoo depends on twibot which will also get installed with the above command.
51
+ Twuckoo depends on twibot and a couple of other gems which will also get installed with the above command.
52
52
 
53
53
  In order for twibot to be able to connect to your twitter account, a config/bot.yml file need to be present at where you launch twuckoo from. It has to contain the following lines at least:
54
54
 
@@ -59,11 +59,17 @@ For more options, see [twibot's README](http://github.com/cjohansen/twibot/tree/
59
59
 
60
60
  ## Configuration
61
61
 
62
- Currently the only thing you can set is the time to wait between tweets. By default, it is "1d", so the script will "relax" for 24 hours after tweeting. If you wish to change this value, just place the following in a config/cuckoo.yml:
62
+ Twuckoo's configuration options have to be written into `config/twuckoo.yml`. The current options are:
63
63
 
64
- time_to_sleep: 1h
64
+ * time_to_sleep
65
+
66
+ By default, it is "1d", so the script will "relax" for 24 hours after tweeting. The value should be given in a human-comprehensible form. You can use any combination of weeks, days, hours, minutes and seconds, so 1w3d13h27m19s will work, too, although you probably do not want to be this precise :)
65
67
 
66
- The value should be given in a human-comprehensible form. You can use any combination of weeks, days, hours, minutes and seconds, so 1w3d13h27m19s will work, too, although you probably do not want to be this precise :)
68
+ * user
69
+ * password
70
+ * email
71
+
72
+ When twuckoo is out of messages to tweet, it quits. Most of the times you'll want to get notified of this, though, so you can take action (e.g refill it and relaunch). If the above options are set, twuckoo sends an email to `email`, using the `user` and `password` credentials for gmail authentication. (Yes, currently only gmail is supported, I'll change that shortly.)
67
73
 
68
74
  ## Running
69
75
 
@@ -71,7 +77,7 @@ You have to indicate the module you wish to use:
71
77
 
72
78
  $ twuckoo file
73
79
 
74
- Will make use of the one_line_from_file module. There has to be a lines.txt file in the directory where you run twuckoo from that contains the possible tweets, one tweet per line. The tweeted lines will be stored in a file called used\_lines.txt so you should have write permission to the directory.
80
+ Will make use of the `file` module. There has to be a lines.txt file in the directory where you run twuckoo from that contains the possible tweets, one tweet per line. The tweeted lines will be stored in a file called used\_lines.txt so you should have write permission to the directory.
75
81
 
76
82
  or
77
83
 
@@ -79,9 +85,17 @@ or
79
85
 
80
86
  (see above)
81
87
 
88
+ You can also provide a `name` for the twuckoo instance which appears in the notifications (if you do not provide a name explicitly, the name of the directory in which your twuckoo instance runs will get used):
89
+
90
+ $ twuckoo -n pragthinklearn file
91
+
82
92
  ## Examples out there
83
93
 
84
- In the course of the development of this gem I "ate my own dogfood" so you'll find one twitter account for each of the modules:
94
+ In the course of the development of this gem I "ate my own dogfood" so you'll find at least one twitter account for each of the modules:
95
+
96
+ * [Pragmatic Thinking and Learning](http://twitter.com/pragthinklearn)
97
+
98
+ An concise advice from the excellent [Pragmatic Thinking and Learning](http://pragprog.com/titles/ahptl/pragmatic-thinking-and-learning) book
85
99
 
86
100
  * [Daily Oblique](http://twitter.com/daily_oblique)
87
101
 
@@ -95,8 +109,8 @@ If you set up something with twuckoo, I would like to know about it, so that I m
95
109
 
96
110
  ## Credits & License
97
111
 
98
- You can go ahead and play with the software as well as modify it, release it under another name, charge for someone that uses your service, etc. A link back to [this page](http://github.com/balinterdi/twuckoo/tree/master) would be appreciated if you release something based on it.
112
+ This software is released under the MIT license (see attached). A link back to [this page](http://github.com/balinterdi/twuckoo/tree/master) would be appreciated if you release something based on it.
99
113
 
100
- Any feedback (especially bug reports!) is highly appreciated, so please do not hesitate to contact me at <balint@bucionrails.com>
114
+ Any feedback (especially bug reports!) is highly appreciated, please report them [here](http://github.com/balinterdi/twuckoo/issues) or contact me at <balint@codigoergosum.com>
101
115
 
102
- Original idea and development: [Balint Erdi](http://bucionrails.com)
116
+ Original idea and development: [Balint Erdi](http://codigoergosum.com)
data/Rakefile CHANGED
@@ -16,6 +16,7 @@ begin
16
16
  gemspec.add_dependency("twibot", ">=0.1.7")
17
17
  gemspec.add_dependency("hpricot", ">= 0.6.164")
18
18
  gemspec.add_dependency("mail", ">= 1.6.0")
19
+ gemspec.add_dependency("tlsmail", ">= 0.0.1")
19
20
  end
20
21
  Jeweler::GemcutterTasks.new
21
22
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
@@ -1,5 +1,7 @@
1
1
  require "optparse"
2
2
  require "ostruct"
3
+ require "twibot"
4
+ require "mail"
3
5
 
4
6
  class TwuckooException < Exception
5
7
  end
data/twuckoo.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{twuckoo}
8
- s.version = "0.3.4"
8
+ s.version = "0.3.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Balint Erdi"]
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.files = [
22
22
  ".gitignore",
23
23
  "CHANGELOG",
24
+ "MIT-LICENSE",
24
25
  "Manifest",
25
26
  "README.markdown",
26
27
  "Rakefile",
@@ -68,12 +69,14 @@ Gem::Specification.new do |s|
68
69
  s.add_runtime_dependency(%q<twibot>, [">= 0.1.7"])
69
70
  s.add_runtime_dependency(%q<hpricot>, [">= 0.6.164"])
70
71
  s.add_runtime_dependency(%q<mail>, [">= 1.6.0"])
72
+ s.add_runtime_dependency(%q<tlsmail>, [">= 0.0.1"])
71
73
  else
72
74
  s.add_dependency(%q<mocha>, [">= 0.9.5"])
73
75
  s.add_dependency(%q<rspec>, [">= 0"])
74
76
  s.add_dependency(%q<twibot>, [">= 0.1.7"])
75
77
  s.add_dependency(%q<hpricot>, [">= 0.6.164"])
76
78
  s.add_dependency(%q<mail>, [">= 1.6.0"])
79
+ s.add_dependency(%q<tlsmail>, [">= 0.0.1"])
77
80
  end
78
81
  else
79
82
  s.add_dependency(%q<mocha>, [">= 0.9.5"])
@@ -81,6 +84,7 @@ Gem::Specification.new do |s|
81
84
  s.add_dependency(%q<twibot>, [">= 0.1.7"])
82
85
  s.add_dependency(%q<hpricot>, [">= 0.6.164"])
83
86
  s.add_dependency(%q<mail>, [">= 1.6.0"])
87
+ s.add_dependency(%q<tlsmail>, [">= 0.0.1"])
84
88
  end
85
89
  end
86
90
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twuckoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balint Erdi
@@ -62,6 +62,16 @@ dependencies:
62
62
  - !ruby/object:Gem::Version
63
63
  version: 1.6.0
64
64
  version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: tlsmail
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 0.0.1
74
+ version:
65
75
  description: " A simple yet elegant solution to tweet a message regularly from a file (from a webpage, a database, etc.)\n"
66
76
  email: balint.erdi@gmail.com
67
77
  executables:
@@ -73,6 +83,7 @@ extra_rdoc_files:
73
83
  files:
74
84
  - .gitignore
75
85
  - CHANGELOG
86
+ - MIT-LICENSE
76
87
  - Manifest
77
88
  - README.markdown
78
89
  - Rakefile