rubytter 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/examples/search.rb +2 -2
- data/lib/rubytter.rb +2 -1
- data/spec/rubytter_spec.rb +4 -1
- data/spec/search.json +1 -0
- metadata +2 -1
data/Rakefile
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.description = "Rubytter is a simple twitter client."
|
21
21
|
s.files = %w( #{Dir['lib/**/*.rb'].join(' ')}
|
22
22
|
#{Dir['spec/**/*.rb'].join(' ')}
|
23
|
+
#{Dir['spec/**/*.json'].join(' ')}
|
23
24
|
#{Dir['examples/**/*.rb'].join(' ')}
|
24
25
|
README.rdoc
|
25
26
|
History.txt
|
data/examples/search.rb
CHANGED
@@ -4,6 +4,6 @@ require 'rubygems'
|
|
4
4
|
require 'rubytter'
|
5
5
|
|
6
6
|
client = Rubytter.new
|
7
|
-
client.search(ARGV[0] || 'rubytter').
|
8
|
-
puts "#{status.
|
7
|
+
client.search(ARGV[0] || 'rubytter').each do |status|
|
8
|
+
puts "#{status.user.screen_name}: #{status.text}"
|
9
9
|
end
|
data/lib/rubytter.rb
CHANGED
@@ -16,7 +16,7 @@ class Rubytter
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
VERSION = '0.6.
|
19
|
+
VERSION = '0.6.1'
|
20
20
|
|
21
21
|
attr_reader :login
|
22
22
|
attr_accessor :host, :header
|
@@ -135,6 +135,7 @@ class Rubytter
|
|
135
135
|
'id' => json['id'],
|
136
136
|
'text' => json['text'],
|
137
137
|
'source' => CGI.unescapeHTML(json['source']),
|
138
|
+
'created_at' => json['created_at'],
|
138
139
|
'in_reply_to_user_id' => json['to_usre_id'],
|
139
140
|
'in_reply_to_screen_name' => json['to_usre'],
|
140
141
|
'in_reply_to_status_id' => nil,
|
data/spec/rubytter_spec.rb
CHANGED
@@ -203,6 +203,7 @@ class Rubytter
|
|
203
203
|
json_data = {
|
204
204
|
'id' => '123',
|
205
205
|
'text' => 'foo foo bar bar',
|
206
|
+
'created_at' => 'Sat, 21 Mar 2009 09:48:20 +0000',
|
206
207
|
'source' => '<a href="http:\/\/twitter.com\/">web<\/a>',
|
207
208
|
'to_usre_id' => '20660692',
|
208
209
|
'to_usre' => 'jugyo_test',
|
@@ -214,6 +215,7 @@ class Rubytter
|
|
214
215
|
result = rubytter.search_result_to_struct(json_data)
|
215
216
|
result['id'].should == '123'
|
216
217
|
result['text'].should == 'foo foo bar bar'
|
218
|
+
result['created_at'].should == 'Sat, 21 Mar 2009 09:48:20 +0000'
|
217
219
|
result['source'].should == "<a href=\"http:\\/\\/twitter.com\\/\">web<\\/a>"
|
218
220
|
result['in_reply_to_user_id'].should == '20660692'
|
219
221
|
result['in_reply_to_screen_name'].should == 'jugyo_test'
|
@@ -230,8 +232,9 @@ class Rubytter
|
|
230
232
|
status = statuses[0]
|
231
233
|
|
232
234
|
status.id.should == 1365281728
|
233
|
-
status.source.should == "<a href=\"http://twitter.com/\">web</a>"
|
234
235
|
status.text.should == "よし、add_hook 呼んでるところが無くなった #termtter"
|
236
|
+
status.created_at.should == "Sat, 21 Mar 2009 09:48:20 +0000"
|
237
|
+
status.source.should == "<a href=\"http://twitter.com/\">web</a>"
|
235
238
|
status.in_reply_to_user_id.should == nil
|
236
239
|
status.in_reply_to_screen_name.should == nil
|
237
240
|
status.in_reply_to_status_id.should == nil
|
data/spec/search.json
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"results":[{"text":"\u3088\u3057\u3001add_hook \u547c\u3093\u3067\u308b\u3068\u3053\u308d\u304c\u7121\u304f\u306a\u3063\u305f #termtter","to_user_id":null,"from_user":"jugyo","id":1365281728,"from_user_id":74941,"iso_language_code":"ja","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63467667\/megane2_normal.png","created_at":"Sat, 21 Mar 2009 09:48:20 +0000"},{"text":"[termtter] http:\/\/bit.ly\/9sOWQ jugyo - Changed to use register_hook.","to_user_id":null,"from_user":"termtter","id":1365279197,"from_user_id":3422637,"iso_language_code":"en","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 09:46:51 +0000"},{"text":"test for msagent plugin of termtter","to_user_id":null,"from_user":"jugyo","id":1365258802,"from_user_id":74941,"iso_language_code":"no","source":"<a href="http:\/\/github.com\/jugyo\/termtter">Termtter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63467667\/megane2_normal.png","created_at":"Sat, 21 Mar 2009 09:35:24 +0000"},{"text":"termtter -e 'update \u5bdd\u308b' \u307f\u305f\u3044\u306a\u611f\u3058\u3067\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3067\u304d\u305f\u3089\u4fbf\u5229\u304b\u306a\u3041","to_user_id":null,"from_user":"jugyo","id":1365097088,"from_user_id":74941,"iso_language_code":"ja","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63467667\/megane2_normal.png","created_at":"Sat, 21 Mar 2009 08:05:57 +0000"},{"text":"Web \u4e0a\u306e\u3069\u3063\u304b\u3057\u3089\u306b\u30b0\u30eb\u30fc\u30d7\u60c5\u5831\u3092\u7f6e\u3044\u3066\u304a\u3051\u308c\u3070 #termtter","to_user_id":null,"from_user":"jugyo","id":1364954500,"from_user_id":74941,"iso_language_code":"ja","source":"<a href="http:\/\/twitterfon.net\/">TwitterFon<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63467667\/megane2_normal.png","created_at":"Sat, 21 Mar 2009 06:54:59 +0000"},{"text":"notify-send \u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4fee\u6b63 #termtter","to_user_id":null,"from_user":"jugyo","id":1364802582,"from_user_id":74941,"iso_language_code":"en","source":"<a href="http:\/\/github.com\/jugyo\/termtter">Termtter<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/63467667\/megane2_normal.png","created_at":"Sat, 21 Mar 2009 05:51:35 +0000"},{"text":"[termtter] http:\/\/bit.ly\/1e3ExY jugyo - Changed to use register_hook.","to_user_id":null,"from_user":"termtter","id":1364800822,"from_user_id":3422637,"iso_language_code":"en","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 05:50:52 +0000"},{"text":"@beatinaniwa termtter!\u30b0\u30eb\u30fc\u30d7\u5316\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3042\u308a\u307e\u3059\u3088\uff0e http:\/\/d.hatena.ne.jp\/hakobe932\/20090107\/1231327037","to_user_id":8021,"to_user":"beatinaniwa","from_user":"yaotti","id":1364768285,"from_user_id":31813,"iso_language_code":"ja","source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/81045219\/cat_normal.jpg","created_at":"Sat, 21 Mar 2009 05:38:29 +0000"},{"text":"termtter","to_user_id":null,"from_user":"keisuke_n","id":1364718890,"from_user_id":60906,"source":"<a href="http:\/\/twitter.com\/">web<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/103481443\/ke-s_normal.png","created_at":"Sat, 21 Mar 2009 05:20:17 +0000"},{"text":"[termtter] http:\/\/bit.ly\/HqTT hitode909 - made load command(this command loads history)","to_user_id":null,"from_user":"termtter","id":1364347378,"from_user_id":3422637,"iso_language_code":"en","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 03:31:32 +0000"},{"text":"[termtter] http:\/\/bit.ly\/1px3BJ hitode909 - group\u306e\u51e6\u7406\u3092\u9ad8\u901f\u5316(\u30e6\u30fc\u30b6\u30fc\u3054\u3068\u306e\u30ed\u30b0\u3092\u30de\u30fc\u30b8\u3059\u308b\u5f62\u306b\u3057\u305f)","to_user_id":null,"from_user":"termtter","id":1364173363,"from_user_id":3422637,"iso_language_code":"ja","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 02:47:09 +0000"},{"text":"[termtter] http:\/\/bit.ly\/l2bs6 hitode909 - limit\u3067ERB\u3092\u4f7f\u3046\u3088\u3046\u306b","to_user_id":null,"from_user":"termtter","id":1363634232,"from_user_id":3422637,"iso_language_code":"pt","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 00:36:12 +0000"},{"text":"[termtter] http:\/\/bit.ly\/Myzz hitode909 - made "get_group_of" method.","to_user_id":null,"from_user":"termtter","id":1363634196,"from_user_id":3422637,"iso_language_code":"en","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Sat, 21 Mar 2009 00:36:12 +0000"},{"text":"[termtter] http:\/\/bit.ly\/4QDvO hitode909 - update_editor\u306eid\u88dc\u5b8c\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\u306b","to_user_id":null,"from_user":"termtter","id":1362078582,"from_user_id":3422637,"iso_language_code":"nl","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Fri, 20 Mar 2009 19:18:26 +0000"},{"text":"[termtter] http:\/\/bit.ly\/e0J2 hitode909 - url_addspace\u304c\u52d5\u304b\u306a\u304b\u3063\u305f\u306e\u3092\u4fee\u6b63","to_user_id":null,"from_user":"termtter","id":1362078539,"from_user_id":3422637,"iso_language_code":"es","source":"<a href="http:\/\/github.com">GitHub<\/a>","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69965634\/termtter_normal.jpg","created_at":"Fri, 20 Mar 2009 19:18:25 +0000"}],"since_id":0,"max_id":1365281728,"refresh_url":"?since_id=1365281728&q=termtter","results_per_page":15,"next_page":"?page=2&max_id=1365281728&q=termtter","completed_in":0.017248,"page":1,"query":"termtter"}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubytter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jugyo
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- lib/rubytter.rb
|
37
37
|
- spec/rubytter_spec.rb
|
38
38
|
- spec/spec_helper.rb
|
39
|
+
- spec/search.json
|
39
40
|
- examples/direct_message.rb
|
40
41
|
- examples/favorite.rb
|
41
42
|
- examples/follow.rb
|