retjilp 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2abfa27b54c9c65411d42b2da87ef91861120ac1
4
- data.tar.gz: 11990c7cbc4e08b08d845967a1677d8fab55ef0f
3
+ metadata.gz: 0be573cb1df2e1d0fd478775132a4c2f825b9cc6
4
+ data.tar.gz: b66e13bf039bd618707330de775555bd20d9e269
5
5
  SHA512:
6
- metadata.gz: 66febc755793570d43e7f8a528d78c54915fe2f160ba1106b4e93b63c0d160f2daefdec204e8889e1db99ec0901ca8449869cc3d6b4e46455cb418fa50452069
7
- data.tar.gz: 8159a921b9d8d4046308c00ac44b9cb6f6a16b1ef31deab3704495d082cd5c617aca8802b3ed7d9c843da89987fdf26540cd6555ed097f9dd4461403437f046b
6
+ metadata.gz: 6f52b3f74b3af7890b5f178554c098fcee04571e39f0dbdf6abb16e9a8744064c8b1033cb647e0c49fcf8ee0789b0e517dde64873d86d1653987fc45b9d51f6b
7
+ data.tar.gz: df55c0104d7d42696c82ba0e7b4c2704bb82e14c87b84c5ca83c0dc90d90c94b84da6a710a3105f38728e52ca9482e43c21721ab21edee401dd00e22b88af275
@@ -6,20 +6,44 @@ Retjilp logs into your account, scans all the tweets from your following
6
6
  list or another defined list for a set of matching words, and retweets
7
7
  the ones that match (using the native retweet API).
8
8
 
9
- Prerequisites of this script are Ruby and the `oauth` and `json_pure`
10
- ruby gems (`gem install <gem>`).
9
+ To install the script, run
10
+
11
+ gem install retjilp
11
12
 
12
13
  To use this script, you will need to have registered an application with
13
14
  <http://twitter.com/apps> to get a consumer key and secret, and fill these
14
- values in the `config` file. After having changed the `config` file, move it
15
- to a dir `.retjilp` in your homedir (i.e. `~/.retjilp`).
15
+ values in a file `config` in the `.retjilp` dir in your homedir (i.e.
16
+ `~/retjilp`). The `config` file should have the following content:
17
+
18
+ {
19
+ /*
20
+ * Consumer key and secret.
21
+ * Get this by registering a new (desktop) application at
22
+ * http://twitter.com/apps
23
+ */
24
+ "consumer_key": "abcdeFghIjklMnOpQrStUv",
25
+ "consumer_secret": "abcdefgh123456789abcdefgh123456789abcdefg",
26
+
27
+ /*
28
+ * The strings that a tweet should be matched against.
29
+ * These strings are matched in lower case.
30
+ */
31
+ "match": ["#sometag", "#someothertag", "someword"]
32
+
33
+ /*
34
+ * List name from which statuses are retweeted.
35
+ * Set this config value if you want to retweet only from
36
+ * this list instead of your following list.
37
+ */
38
+ /* "retweet_from_list": "auto-retweet" */
39
+ }
16
40
 
17
41
  To start the script, run
18
42
 
19
- ./retjilp.rb
43
+ retjilp
20
44
 
21
45
  To get a list of command-line parameters, use the `--help` option.
22
46
 
23
47
  The first time the script is run, it will ask you to authorize the application
24
- in your twitter account. After this is done, the script will automatically log
48
+ in your Twitter account. After this is done, the script will automatically log
25
49
  in the next time it is run.
@@ -0,0 +1,30 @@
1
+ require 'yard'
2
+ require 'rake/testtask'
3
+ require 'rubygems/package_task'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec) do |s|
7
+ s.pattern = 'test/spec/*_spec.rb'
8
+ end
9
+
10
+ #Rake::TestTask.new do |t|
11
+ # t.libs << 'test'
12
+ #end
13
+
14
+ YARD::Rake::YardocTask.new do |t|
15
+ t.files = ['lib/**/*.rb', '-', 'README.markdown', 'COPYING']
16
+ t.options = ['--no-private', '--protected']
17
+ end
18
+
19
+ spec = eval(File.read('retjilp.gemspec'))
20
+ Gem::PackageTask.new(spec) do |pkg|
21
+ pkg.gem_spec = spec
22
+ end
23
+
24
+ desc "Run tests"
25
+ task :test => :spec
26
+
27
+ task :default => :test
28
+
29
+
30
+
@@ -0,0 +1,134 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Retjilp
8
+
9
+ &mdash; Documentation by YARD 0.8.5.2
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (R)</a> &raquo;
35
+
36
+
37
+ <span class="title">Retjilp</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Retjilp
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/retjilp/runner.rb<span class="defines">,<br />
83
+ lib/retjilp/options.rb,<br /> lib/retjilp/retweeter.rb</span>
84
+ </dd>
85
+
86
+ </dl>
87
+ <div class="clear"></div>
88
+
89
+ <h2>Defined Under Namespace</h2>
90
+ <p class="children">
91
+
92
+
93
+
94
+
95
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Retjilp/Options.html" title="Retjilp::Options (class)">Options</a></span>, <span class='object_link'><a href="Retjilp/Retweeter.html" title="Retjilp::Retweeter (class)">Retweeter</a></span>, <span class='object_link'><a href="Retjilp/Runner.html" title="Retjilp::Runner (class)">Runner</a></span>
96
+
97
+
98
+ </p>
99
+
100
+ <h2>Constant Summary</h2>
101
+
102
+ <dl class="constants">
103
+
104
+ <dt id="TWITTER_URI-constant" class="">TWITTER_URI =
105
+
106
+ </dt>
107
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com</span><span class='tstring_end'>&quot;</span></span></pre></dd>
108
+
109
+ <dt id="API_VERSION-constant" class="">API_VERSION =
110
+
111
+ </dt>
112
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.1</span><span class='tstring_end'>&quot;</span></span></pre></dd>
113
+
114
+ </dl>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ </div>
126
+
127
+ <div id="footer">
128
+ Generated on Sat Mar 2 22:44:52 2013 by
129
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
+ 0.8.5.2 (ruby-2.0.0).
131
+ </div>
132
+
133
+ </body>
134
+ </html>
@@ -0,0 +1,308 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Retjilp::Options
8
+
9
+ &mdash; Documentation by YARD 0.8.5.2
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (O)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Retjilp.html" title="Retjilp (module)">Retjilp</a></span></span>
36
+ &raquo;
37
+ <span class="title">Options</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Retjilp::Options
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Retjilp::Options</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/retjilp/options.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#log_level-instance_method" title="#log_level (instance method)">- (Object) <strong>log_level</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Returns the value of attribute log_level.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ </ul>
139
+
140
+
141
+
142
+
143
+
144
+ <h2>
145
+ Instance Method Summary
146
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Options) <strong>initialize</strong>(argv) </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+ <span class="note title constructor">constructor</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <span class="summary_desc"><div class='inline'>
171
+ <p>A new instance of Options.</p>
172
+ </div></span>
173
+
174
+ </li>
175
+
176
+
177
+ </ul>
178
+
179
+
180
+ <div id="constructor_details" class="method_details_list">
181
+ <h2>Constructor Details</h2>
182
+
183
+ <div class="method_details first">
184
+ <h3 class="signature first" id="initialize-instance_method">
185
+
186
+ - (<tt><span class='object_link'><a href="" title="Retjilp::Options (class)">Options</a></span></tt>) <strong>initialize</strong>(argv)
187
+
188
+
189
+
190
+
191
+
192
+ </h3><div class="docstring">
193
+ <div class="discussion">
194
+
195
+ <p>A new instance of Options</p>
196
+
197
+
198
+ </div>
199
+ </div>
200
+ <div class="tags">
201
+
202
+
203
+ </div><table class="source_code">
204
+ <tr>
205
+ <td>
206
+ <pre class="lines">
207
+
208
+
209
+ 8
210
+ 9
211
+ 10
212
+ 11
213
+ 12
214
+ 13
215
+ 14
216
+ 15
217
+ 16
218
+ 17
219
+ 18
220
+ 19
221
+ 20
222
+ 21
223
+ 22</pre>
224
+ </td>
225
+ <td>
226
+ <pre class="code"><span class="info file"># File 'lib/retjilp/options.rb', line 8</span>
227
+
228
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_argv'>argv</span><span class='rparen'>)</span>
229
+ <span class='ivar'>@log_level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>WARN</span>
230
+ <span class='const'>OptionParser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_opts'>opts</span><span class='op'>|</span>
231
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Usage: retjilp [ --help ] [ --verbose | --debug ]</span><span class='tstring_end'>&quot;</span></span>
232
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--verbose</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Run with verbose output</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@log_level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>INFO</span> <span class='rbrace'>}</span>
233
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--debug</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Run with debug output</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@log_level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>DEBUG</span> <span class='rbrace'>}</span>
234
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on_tail'>on_tail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-h</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--help</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Show this help</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_opts'>opts</span> <span class='semicolon'>;</span> <span class='id identifier rubyid_exit'>exit</span> <span class='rbrace'>}</span>
235
+ <span class='kw'>begin</span>
236
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='id identifier rubyid_argv'>argv</span><span class='rparen'>)</span>
237
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
238
+ <span class='const'>STDERR</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span>
239
+ <span class='id identifier rubyid_exit'>exit</span><span class='lparen'>(</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span>
240
+ <span class='kw'>end</span>
241
+ <span class='kw'>end</span>
242
+ <span class='kw'>end</span></pre>
243
+ </td>
244
+ </tr>
245
+ </table>
246
+ </div>
247
+
248
+ </div>
249
+
250
+ <div id="instance_attr_details" class="attr_details">
251
+ <h2>Instance Attribute Details</h2>
252
+
253
+
254
+ <span id=""></span>
255
+ <div class="method_details first">
256
+ <h3 class="signature first" id="log_level-instance_method">
257
+
258
+ - (<tt>Object</tt>) <strong>log_level</strong> <span class="extras">(readonly)</span>
259
+
260
+
261
+
262
+
263
+
264
+ </h3><div class="docstring">
265
+ <div class="discussion">
266
+
267
+ <p>Returns the value of attribute log_level</p>
268
+
269
+
270
+ </div>
271
+ </div>
272
+ <div class="tags">
273
+
274
+
275
+ </div><table class="source_code">
276
+ <tr>
277
+ <td>
278
+ <pre class="lines">
279
+
280
+
281
+ 6
282
+ 7
283
+ 8</pre>
284
+ </td>
285
+ <td>
286
+ <pre class="code"><span class="info file"># File 'lib/retjilp/options.rb', line 6</span>
287
+
288
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_level'>log_level</span>
289
+ <span class='ivar'>@log_level</span>
290
+ <span class='kw'>end</span></pre>
291
+ </td>
292
+ </tr>
293
+ </table>
294
+ </div>
295
+
296
+ </div>
297
+
298
+
299
+ </div>
300
+
301
+ <div id="footer">
302
+ Generated on Sat Mar 2 22:44:52 2013 by
303
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
304
+ 0.8.5.2 (ruby-2.0.0).
305
+ </div>
306
+
307
+ </body>
308
+ </html>