fetcher-microdata-twitter 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/features/stepdefs/translate_retweet_to_schema.rb +7 -0
- data/features/stepdefs/translate_tweet_to_schema.rb +0 -1
- data/features/support/env.rb +1 -0
- data/features/translate_retweet_to_schema.feature +330 -0
- data/lib/fetcher-microdata-twitter.rb +4 -0
- data/lib/fetcher/microdata/review/twitter/coercer.rb +23 -0
- data/lib/fetcher/microdata/twitter/version.rb +1 -1
- data/spec/fetcher/microdata/review/twitter/coercer_spec.rb +56 -0
- data/spec/original_tweet_that_is_retweeted.json +65 -0
- data/spec/retweet.json +141 -0
- metadata +13 -8
data/Gemfile
CHANGED
data/features/support/env.rb
CHANGED
@@ -0,0 +1,330 @@
|
|
1
|
+
Feature: Translate ReTweet to schema.org/Review + schema.org/Article/Small + getfetcher.net/Item
|
2
|
+
In order to send a standarized-properties form of the tweet
|
3
|
+
As a developer
|
4
|
+
I want to be able to convert from Twitter API Tweet to
|
5
|
+
schema.org based vocabulary
|
6
|
+
|
7
|
+
Scenario: Converting a json retweet into a json schema
|
8
|
+
Given the retweet:
|
9
|
+
"""
|
10
|
+
{
|
11
|
+
"id_str":"269556600040214528",
|
12
|
+
"geo":null,
|
13
|
+
"text":"RT @xaviervia: El mate me está produciendo dolor de panza pero no voy a dejar de tomar!",
|
14
|
+
"created_at":"Fri Nov 16 21:44:36 +0000 2012",
|
15
|
+
"in_reply_to_user_id_str":null,
|
16
|
+
"in_reply_to_screen_name":null,
|
17
|
+
"coordinates":null,
|
18
|
+
"retweeted":false,
|
19
|
+
"contributors":null,
|
20
|
+
"truncated":false,
|
21
|
+
"source":"web",
|
22
|
+
"entities":
|
23
|
+
{
|
24
|
+
"urls":[],
|
25
|
+
"user_mentions":[
|
26
|
+
{
|
27
|
+
"id_str":"173389269",
|
28
|
+
"indices":[3, 13],
|
29
|
+
"screen_name":"xaviervia",
|
30
|
+
"name":"Xavier Via",
|
31
|
+
"id":173389269
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"hashtags":[]
|
35
|
+
},
|
36
|
+
"in_reply_to_user_id":null,
|
37
|
+
"in_reply_to_status_id":null,
|
38
|
+
"retweeted_status":
|
39
|
+
{
|
40
|
+
"id_str":"269551666888601600",
|
41
|
+
"geo":null,
|
42
|
+
"text":"El mate me está produciendo dolor de panza pero no voy a dejar de tomar!",
|
43
|
+
"created_at":"Fri Nov 16 21:25:00 +0000 2012",
|
44
|
+
"in_reply_to_user_id_str":null,
|
45
|
+
"in_reply_to_screen_name":null,
|
46
|
+
"coordinates":null,
|
47
|
+
"retweeted":false,
|
48
|
+
"contributors":null,
|
49
|
+
"truncated":false,
|
50
|
+
"source":"web",
|
51
|
+
"entities":
|
52
|
+
{
|
53
|
+
"urls":[],
|
54
|
+
"user_mentions":[],
|
55
|
+
"hashtags":[]
|
56
|
+
},
|
57
|
+
"in_reply_to_user_id":null,
|
58
|
+
"in_reply_to_status_id":null,
|
59
|
+
"place":null,
|
60
|
+
"retweet_count":0,
|
61
|
+
"favorited":false,
|
62
|
+
"user":
|
63
|
+
{
|
64
|
+
"id_str":"173389269",
|
65
|
+
"created_at":"Sun Aug 01 09:52:47 +0000 2010",
|
66
|
+
"friends_count":30,
|
67
|
+
"default_profile":true,
|
68
|
+
"profile_sidebar_border_color":"C0DEED",
|
69
|
+
"url":"http://xaviervia.com.ar",
|
70
|
+
"statuses_count":136,
|
71
|
+
"profile_use_background_image":true,
|
72
|
+
"profile_background_image_url_https":"https://si0.twimg.com/images/themes/theme1/bg.png",
|
73
|
+
"profile_image_url":"http://a0.twimg.com/profile_images/1766866055/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
74
|
+
"description":"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast.",
|
75
|
+
"verified":false,
|
76
|
+
"geo_enabled":false,
|
77
|
+
"profile_text_color":"333333",
|
78
|
+
"location":"Buenos Aires, Argentina",
|
79
|
+
"default_profile_image":false,
|
80
|
+
"lang":"es",
|
81
|
+
"profile_background_image_url":"http://a0.twimg.com/images/themes/theme1/bg.png",
|
82
|
+
"favourites_count":4,
|
83
|
+
"profile_link_color":"0084B4",
|
84
|
+
"profile_image_url_https":"https://si0.twimg.com/profile_images/1766866055/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
85
|
+
"notifications":null,
|
86
|
+
"followers_count":17,
|
87
|
+
"protected":false,
|
88
|
+
"screen_name":"xaviervia",
|
89
|
+
"follow_request_sent":null,
|
90
|
+
"contributors_enabled":false,
|
91
|
+
"following":null,
|
92
|
+
"time_zone":"Buenos Aires",
|
93
|
+
"profile_background_color":"C0DEED",
|
94
|
+
"name":"Xavier Via",
|
95
|
+
"profile_background_tile":false,
|
96
|
+
"id":173389269,
|
97
|
+
"is_translator":false,
|
98
|
+
"listed_count":0,
|
99
|
+
"utc_offset":-10800,
|
100
|
+
"profile_sidebar_fill_color":"DDEEF6"
|
101
|
+
},
|
102
|
+
"id":269551666888601600,
|
103
|
+
"in_reply_to_status_id_str":null
|
104
|
+
},
|
105
|
+
"place":null,
|
106
|
+
"retweet_count":0,
|
107
|
+
"favorited":false,
|
108
|
+
"user":
|
109
|
+
{
|
110
|
+
"id_str":"308762265",
|
111
|
+
"created_at":"Tue May 31 23:36:05 +0000 2011",
|
112
|
+
"friends_count":72,
|
113
|
+
"default_profile":true,
|
114
|
+
"profile_sidebar_border_color":"C0DEED",
|
115
|
+
"url":null,
|
116
|
+
"statuses_count":131,
|
117
|
+
"profile_use_background_image":true,
|
118
|
+
"profile_background_image_url_https":"https://si0.twimg.com/images/themes/theme1/bg.png",
|
119
|
+
"profile_image_url":"http://a0.twimg.com/profile_images/2317655970/6o3qtl1efagg8gwqw9vy_normal.jpeg",
|
120
|
+
"description":"Ruby Developer",
|
121
|
+
"verified":false,
|
122
|
+
"geo_enabled":false,
|
123
|
+
"profile_text_color":"333333",
|
124
|
+
"location":"Buenos Aires",
|
125
|
+
"default_profile_image":false,
|
126
|
+
"lang":"fr",
|
127
|
+
"profile_background_image_url":"http://a0.twimg.com/images/themes/theme1/bg.png",
|
128
|
+
"favourites_count":0,
|
129
|
+
"profile_link_color":"0084B4",
|
130
|
+
"profile_image_url_https":"https://si0.twimg.com/profile_images/2317655970/6o3qtl1efagg8gwqw9vy_normal.jpeg",
|
131
|
+
"notifications":null,
|
132
|
+
"followers_count":18,
|
133
|
+
"protected":false,
|
134
|
+
"screen_name":"_Olivier_D",
|
135
|
+
"follow_request_sent":null,
|
136
|
+
"contributors_enabled":false,
|
137
|
+
"following":null,
|
138
|
+
"time_zone":"Buenos Aires",
|
139
|
+
"profile_background_color":"C0DEED",
|
140
|
+
"name":"Olivier",
|
141
|
+
"profile_background_tile":false,
|
142
|
+
"id":308762265,
|
143
|
+
"is_translator":false,
|
144
|
+
"listed_count":0,
|
145
|
+
"utc_offset":-10800,
|
146
|
+
"profile_sidebar_fill_color":"DDEEF6"
|
147
|
+
},
|
148
|
+
"id":269556600040214528,
|
149
|
+
"in_reply_to_status_id_str":null
|
150
|
+
}
|
151
|
+
|
152
|
+
"""
|
153
|
+
And the viewer:
|
154
|
+
"""
|
155
|
+
{
|
156
|
+
"created_at": "Sun Aug 01 09:52:47 +0000 2010",
|
157
|
+
"id": 173389269,
|
158
|
+
"name": "Xavier Via",
|
159
|
+
"description": "Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast.",
|
160
|
+
"screen_name": "xaviervia"
|
161
|
+
}
|
162
|
+
"""
|
163
|
+
When I convert it into schema.org/Review
|
164
|
+
Then I should have:
|
165
|
+
"""
|
166
|
+
{
|
167
|
+
"type": [
|
168
|
+
"http://schema.org/Review"
|
169
|
+
],
|
170
|
+
"properties": {
|
171
|
+
"additionalType": [
|
172
|
+
"http://getfetcher.net/Item"
|
173
|
+
],
|
174
|
+
"Item#id": [
|
175
|
+
269556600040214528
|
176
|
+
],
|
177
|
+
"reviewBody": [
|
178
|
+
"RT @xaviervia: El mate me está produciendo dolor de panza pero no voy a dejar de tomar!"
|
179
|
+
],
|
180
|
+
"author": [
|
181
|
+
{
|
182
|
+
"type": [
|
183
|
+
"http://schema.org/Person/User"
|
184
|
+
],
|
185
|
+
"properties": {
|
186
|
+
"additionalType": [
|
187
|
+
"http://getfetcher.net/Item"
|
188
|
+
],
|
189
|
+
"Item#id": [
|
190
|
+
308762265
|
191
|
+
],
|
192
|
+
"name": [
|
193
|
+
"Olivier"
|
194
|
+
],
|
195
|
+
"User#dateRegistered": [
|
196
|
+
1306884965
|
197
|
+
],
|
198
|
+
"description": [
|
199
|
+
"Ruby Developer"
|
200
|
+
],
|
201
|
+
"url": [
|
202
|
+
"https://twitter.com/_Olivier_D"
|
203
|
+
]
|
204
|
+
}
|
205
|
+
}
|
206
|
+
],
|
207
|
+
"Item#viewer": [
|
208
|
+
{
|
209
|
+
"type": [
|
210
|
+
"http://schema.org/Person/User"
|
211
|
+
],
|
212
|
+
"properties": {
|
213
|
+
"additionalType": [
|
214
|
+
"http://getfetcher.net/Item"
|
215
|
+
],
|
216
|
+
"Item#id": [
|
217
|
+
173389269
|
218
|
+
],
|
219
|
+
"name": [
|
220
|
+
"Xavier Via"
|
221
|
+
],
|
222
|
+
"User#dateRegistered": [
|
223
|
+
1280656367
|
224
|
+
],
|
225
|
+
"description": [
|
226
|
+
"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast."
|
227
|
+
],
|
228
|
+
"url": [
|
229
|
+
"https://twitter.com/xaviervia"
|
230
|
+
]
|
231
|
+
}
|
232
|
+
}
|
233
|
+
],
|
234
|
+
"dateCreated": [
|
235
|
+
1353102276
|
236
|
+
],
|
237
|
+
"provider": [
|
238
|
+
"twitter",
|
239
|
+
"web"
|
240
|
+
],
|
241
|
+
"url": [
|
242
|
+
"https://twitter.com/_Olivier_D/status/269556600040214528"
|
243
|
+
],
|
244
|
+
"itemReviewed": [
|
245
|
+
|
246
|
+
{
|
247
|
+
"type": [
|
248
|
+
"http://schema.org/Article/Small"
|
249
|
+
],
|
250
|
+
"properties": {
|
251
|
+
"additionalType": [
|
252
|
+
"http://getfetcher.net/Item"
|
253
|
+
],
|
254
|
+
"Item#id": [
|
255
|
+
269551666888601600
|
256
|
+
],
|
257
|
+
"articleBody": [
|
258
|
+
"El mate me est\u00e1 produciendo dolor de panza pero no voy a dejar de tomar!"
|
259
|
+
],
|
260
|
+
"author": [
|
261
|
+
{
|
262
|
+
"type": [
|
263
|
+
"http://schema.org/Person/User"
|
264
|
+
],
|
265
|
+
"properties": {
|
266
|
+
"additionalType": [
|
267
|
+
"http://getfetcher.net/Item"
|
268
|
+
],
|
269
|
+
"Item#id": [
|
270
|
+
173389269
|
271
|
+
],
|
272
|
+
"name": [
|
273
|
+
"Xavier Via"
|
274
|
+
],
|
275
|
+
"User#dateRegistered": [
|
276
|
+
"Sun Aug 01 09:52:47 +0000 2010"
|
277
|
+
],
|
278
|
+
"description": [
|
279
|
+
"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast."
|
280
|
+
],
|
281
|
+
"url": [
|
282
|
+
"https://twitter.com/xaviervia"
|
283
|
+
]
|
284
|
+
}
|
285
|
+
}
|
286
|
+
],
|
287
|
+
"Item#viewer": [
|
288
|
+
{
|
289
|
+
"type": [
|
290
|
+
"http://schema.org/Person/User"
|
291
|
+
],
|
292
|
+
"properties": {
|
293
|
+
"additionalType": [
|
294
|
+
"http://getfetcher.net/Item"
|
295
|
+
],
|
296
|
+
"Item#id": [
|
297
|
+
173389269
|
298
|
+
],
|
299
|
+
"name": [
|
300
|
+
"Xavier Via"
|
301
|
+
],
|
302
|
+
"User#dateRegistered": [
|
303
|
+
1280656367
|
304
|
+
],
|
305
|
+
"description": [
|
306
|
+
"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast."
|
307
|
+
],
|
308
|
+
"url": [
|
309
|
+
"https://twitter.com/xaviervia"
|
310
|
+
]
|
311
|
+
}
|
312
|
+
}
|
313
|
+
],
|
314
|
+
"dateCreated": [
|
315
|
+
"Fri Nov 16 21:25:00 +0000 2012"
|
316
|
+
],
|
317
|
+
"provider": [
|
318
|
+
"twitter",
|
319
|
+
"web"
|
320
|
+
],
|
321
|
+
"url": [
|
322
|
+
"https://twitter.com/xaviervia/status/269551666888601600"
|
323
|
+
]
|
324
|
+
}
|
325
|
+
}
|
326
|
+
|
327
|
+
]
|
328
|
+
}
|
329
|
+
}
|
330
|
+
"""
|
@@ -1,8 +1,12 @@
|
|
1
1
|
require 'fetcher-microdata'
|
2
2
|
require 'singleton'
|
3
3
|
require 'json'
|
4
|
+
require 'twitter'
|
5
|
+
require 'symbolmatrix'
|
6
|
+
|
4
7
|
|
5
8
|
require 'fetcher/microdata/person_user/twitter/coercer'
|
6
9
|
require 'fetcher/microdata/article_small/twitter/coercer'
|
10
|
+
require 'fetcher/microdata/review/twitter/coercer'
|
7
11
|
|
8
12
|
require 'fetcher/microdata/twitter/service'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'pry'
|
2
|
+
|
3
|
+
module Fetcher
|
4
|
+
class Microdata
|
5
|
+
class Review
|
6
|
+
module Twitter
|
7
|
+
Coercer = proc { |retweet, viewer|
|
8
|
+
{
|
9
|
+
:id => retweet["id"],
|
10
|
+
:additionalType => "http://getfetcher.net/Item",
|
11
|
+
:articleBody => retweet["text"],
|
12
|
+
:author => PersonUser.new(:twitter, retweet["user"]),
|
13
|
+
:viewer => PersonUser.new(:twitter, viewer),
|
14
|
+
:dateCreated => Fetcher::Microdata::Twitter::Service.instance.created_at_to_timestamp(retweet["created_at"]),
|
15
|
+
:provider => ["twitter", retweet["source"]],
|
16
|
+
:url => "https://twitter.com/#{retweet["user"]["screen_name"]}/status/#{retweet["id"]}",
|
17
|
+
:original_tweet => ArticleSmall.new(:twitter, retweet["retweeted_status"], retweet["retweeted_status"]["user"])
|
18
|
+
}
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Fetcher::Microdata::Review::Twitter::Coercer' do
|
4
|
+
context 'the adapter receives a valid retweet and a valid viewer' do
|
5
|
+
before do
|
6
|
+
@retweet = JSON.parse File.read 'spec/retweet.json'
|
7
|
+
@original_tweet_retweeted = JSON.parse File.read 'spec/original_tweet_that_is_retweeted.json'
|
8
|
+
@viewer = JSON.parse File.read 'spec/viewer.json'
|
9
|
+
@adapter = Fetcher::Microdata::Review::Twitter::Coercer.call @retweet, @viewer
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should set #id with the value of "id"' do
|
13
|
+
@adapter[:id].should == @retweet["id"]
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should set #additionalType as the getfetcher/Item type' do
|
17
|
+
@adapter[:additionalType].should == "http://getfetcher.net/Item"
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should set #articleBody with the value of "text"' do
|
21
|
+
@adapter[:articleBody].should == @retweet["text"]
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should set #author with the Person from the value of "user" > "name"' do
|
25
|
+
@adapter[:author].attributes.should == Fetcher::Microdata::PersonUser.new(:twitter, @retweet["user"]).attributes
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should set #viewer with the Person from the value of "user" > "name"' do
|
29
|
+
@adapter[:viewer].attributes.should == Fetcher::Microdata::PersonUser.new(:twitter, @viewer).attributes
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should set #dateCreated with the timestamp obtained from "created_at"' do
|
33
|
+
@adapter[:dateCreated].should == 1353102276
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should set #provider as an array, coming Twitter first and then the "source"' do
|
37
|
+
@adapter[:provider].should == ["twitter", @retweet["source"]]
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should set #url compiling the basic url with the "id" and the "user" > "screen_name"' do
|
41
|
+
@adapter[:url].should == "https://twitter.com/#{@retweet["user"]["screen_name"]}/status/#{@retweet["id"]}"
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should set the review with the original tweet' do
|
45
|
+
original_tweet = Fetcher::Microdata::ArticleSmall.new :twitter, @original_tweet_retweeted, @viewer
|
46
|
+
@adapter[:original_tweet][:id].should == original_tweet[:id]
|
47
|
+
@adapter[:original_tweet][:additionalType].should == original_tweet[:additionalType]
|
48
|
+
@adapter[:original_tweet][:articleBody].should == original_tweet[:articleBody]
|
49
|
+
@adapter[:original_tweet][:author][:id].should == original_tweet[:author][:id]
|
50
|
+
@adapter[:original_tweet][:viewer][:id].should == original_tweet[:viewer][:id]
|
51
|
+
@adapter[:original_tweet][:dateCreated].should == original_tweet[:dateCreated]
|
52
|
+
@adapter[:original_tweet][:provider].should == original_tweet[:provider]
|
53
|
+
@adapter[:original_tweet][:url].should == original_tweet[:url]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
{
|
2
|
+
"created_at":"Fri Nov 16 21:25:00 +0000 2012",
|
3
|
+
"id":269551666888601600,
|
4
|
+
"id_str":"269551666888601600",
|
5
|
+
"text":"El mate me est\u00e1 produciendo dolor de panza pero no voy a dejar de tomar!",
|
6
|
+
"source":"web",
|
7
|
+
"truncated":false,
|
8
|
+
"in_reply_to_status_id":null,
|
9
|
+
"in_reply_to_status_id_str":null,
|
10
|
+
"in_reply_to_user_id":null,
|
11
|
+
"in_reply_to_user_id_str":null,
|
12
|
+
"in_reply_to_screen_name":null,
|
13
|
+
"user":{
|
14
|
+
"id":173389269,
|
15
|
+
"id_str":"173389269",
|
16
|
+
"name":"Xavier Via",
|
17
|
+
"screen_name":"xaviervia",
|
18
|
+
"location":"Buenos Aires, Argentina",
|
19
|
+
"url":"http:\/\/xaviervia.com.ar",
|
20
|
+
"description":"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast.",
|
21
|
+
"protected":false,
|
22
|
+
"followers_count":18,
|
23
|
+
"friends_count":31,
|
24
|
+
"listed_count":0,
|
25
|
+
"created_at":"Sun Aug 01 09:52:47 +0000 2010",
|
26
|
+
"favourites_count":4,
|
27
|
+
"utc_offset":-10800,
|
28
|
+
"time_zone":"Buenos Aires",
|
29
|
+
"geo_enabled":false,
|
30
|
+
"verified":false,
|
31
|
+
"statuses_count":141,
|
32
|
+
"lang":"es",
|
33
|
+
"contributors_enabled":false,
|
34
|
+
"is_translator":false,
|
35
|
+
"profile_background_color":"C0DEED",
|
36
|
+
"profile_background_image_url":"http:\/\/a0.twimg.com\/images\/themes\/theme1\/bg.png",
|
37
|
+
"profile_background_image_url_https":"https:\/\/si0.twimg.com\/images\/themes\/theme1\/bg.png",
|
38
|
+
"profile_background_tile":false,
|
39
|
+
"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1766866055\/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
40
|
+
"profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1766866055\/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
41
|
+
"profile_link_color":"0084B4",
|
42
|
+
"profile_sidebar_border_color":"C0DEED",
|
43
|
+
"profile_sidebar_fill_color":"DDEEF6",
|
44
|
+
"profile_text_color":"333333",
|
45
|
+
"profile_use_background_image":true,
|
46
|
+
"default_profile":true,
|
47
|
+
"default_profile_image":false,
|
48
|
+
"following":null,
|
49
|
+
"follow_request_sent":null,
|
50
|
+
"notifications":null
|
51
|
+
},
|
52
|
+
"geo":null,
|
53
|
+
"coordinates":null,
|
54
|
+
"place":null,
|
55
|
+
"contributors":null,
|
56
|
+
"retweet_count":1,
|
57
|
+
"entities":
|
58
|
+
{
|
59
|
+
"hashtags":[],
|
60
|
+
"urls":[],
|
61
|
+
"user_mentions":[]
|
62
|
+
},
|
63
|
+
"favorited":false,
|
64
|
+
"retweeted":false
|
65
|
+
}
|
data/spec/retweet.json
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
{
|
2
|
+
"id_str":"269556600040214528",
|
3
|
+
"geo":null,
|
4
|
+
"text":"RT @xaviervia: El mate me está produciendo dolor de panza pero no voy a dejar de tomar!",
|
5
|
+
"created_at":"Fri Nov 16 21:44:36 +0000 2012",
|
6
|
+
"in_reply_to_user_id_str":null,
|
7
|
+
"in_reply_to_screen_name":null,
|
8
|
+
"coordinates":null,
|
9
|
+
"retweeted":false,
|
10
|
+
"contributors":null,
|
11
|
+
"truncated":false,
|
12
|
+
"source":"web",
|
13
|
+
"entities":
|
14
|
+
{
|
15
|
+
"urls":[],
|
16
|
+
"user_mentions":[
|
17
|
+
{
|
18
|
+
"id_str":"173389269",
|
19
|
+
"indices":[3, 13],
|
20
|
+
"screen_name":"xaviervia",
|
21
|
+
"name":"Xavier Via",
|
22
|
+
"id":173389269
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"hashtags":[]
|
26
|
+
},
|
27
|
+
"in_reply_to_user_id":null,
|
28
|
+
"in_reply_to_status_id":null,
|
29
|
+
"retweeted_status":
|
30
|
+
{
|
31
|
+
"id_str":"269551666888601600",
|
32
|
+
"geo":null,
|
33
|
+
"text":"El mate me está produciendo dolor de panza pero no voy a dejar de tomar!",
|
34
|
+
"created_at":"Fri Nov 16 21:25:00 +0000 2012",
|
35
|
+
"in_reply_to_user_id_str":null,
|
36
|
+
"in_reply_to_screen_name":null,
|
37
|
+
"coordinates":null,
|
38
|
+
"retweeted":false,
|
39
|
+
"contributors":null,
|
40
|
+
"truncated":false,
|
41
|
+
"source":"web",
|
42
|
+
"entities":
|
43
|
+
{
|
44
|
+
"urls":[],
|
45
|
+
"user_mentions":[],
|
46
|
+
"hashtags":[]
|
47
|
+
},
|
48
|
+
"in_reply_to_user_id":null,
|
49
|
+
"in_reply_to_status_id":null,
|
50
|
+
"place":null,
|
51
|
+
"retweet_count":0,
|
52
|
+
"favorited":false,
|
53
|
+
"user":
|
54
|
+
{
|
55
|
+
"id_str":"173389269",
|
56
|
+
"created_at":"Sun Aug 01 09:52:47 +0000 2010",
|
57
|
+
"friends_count":30,
|
58
|
+
"default_profile":true,
|
59
|
+
"profile_sidebar_border_color":"C0DEED",
|
60
|
+
"url":"http://xaviervia.com.ar",
|
61
|
+
"statuses_count":136,
|
62
|
+
"profile_use_background_image":true,
|
63
|
+
"profile_background_image_url_https":"https://si0.twimg.com/images/themes/theme1/bg.png",
|
64
|
+
"profile_image_url":"http://a0.twimg.com/profile_images/1766866055/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
65
|
+
"description":"Web Developer specialized in Ruby.\r\n\r\nComputer Science enthusiast.",
|
66
|
+
"verified":false,
|
67
|
+
"geo_enabled":false,
|
68
|
+
"profile_text_color":"333333",
|
69
|
+
"location":"Buenos Aires, Argentina",
|
70
|
+
"default_profile_image":false,
|
71
|
+
"lang":"es",
|
72
|
+
"profile_background_image_url":"http://a0.twimg.com/images/themes/theme1/bg.png",
|
73
|
+
"favourites_count":4,
|
74
|
+
"profile_link_color":"0084B4",
|
75
|
+
"profile_image_url_https":"https://si0.twimg.com/profile_images/1766866055/389182_10150390045754380_619554379_8049194_954086064_n_normal.jpg",
|
76
|
+
"notifications":null,
|
77
|
+
"followers_count":17,
|
78
|
+
"protected":false,
|
79
|
+
"screen_name":"xaviervia",
|
80
|
+
"follow_request_sent":null,
|
81
|
+
"contributors_enabled":false,
|
82
|
+
"following":null,
|
83
|
+
"time_zone":"Buenos Aires",
|
84
|
+
"profile_background_color":"C0DEED",
|
85
|
+
"name":"Xavier Via",
|
86
|
+
"profile_background_tile":false,
|
87
|
+
"id":173389269,
|
88
|
+
"is_translator":false,
|
89
|
+
"listed_count":0,
|
90
|
+
"utc_offset":-10800,
|
91
|
+
"profile_sidebar_fill_color":"DDEEF6"
|
92
|
+
},
|
93
|
+
"id":269551666888601600,
|
94
|
+
"in_reply_to_status_id_str":null
|
95
|
+
},
|
96
|
+
"place":null,
|
97
|
+
"retweet_count":0,
|
98
|
+
"favorited":false,
|
99
|
+
"user":
|
100
|
+
{
|
101
|
+
"id_str":"308762265",
|
102
|
+
"created_at":"Tue May 31 23:36:05 +0000 2011",
|
103
|
+
"friends_count":72,
|
104
|
+
"default_profile":true,
|
105
|
+
"profile_sidebar_border_color":"C0DEED",
|
106
|
+
"url":null,
|
107
|
+
"statuses_count":131,
|
108
|
+
"profile_use_background_image":true,
|
109
|
+
"profile_background_image_url_https":"https://si0.twimg.com/images/themes/theme1/bg.png",
|
110
|
+
"profile_image_url":"http://a0.twimg.com/profile_images/2317655970/6o3qtl1efagg8gwqw9vy_normal.jpeg",
|
111
|
+
"description":"Ruby Developer",
|
112
|
+
"verified":false,
|
113
|
+
"geo_enabled":false,
|
114
|
+
"profile_text_color":"333333",
|
115
|
+
"location":"Buenos Aires",
|
116
|
+
"default_profile_image":false,
|
117
|
+
"lang":"fr",
|
118
|
+
"profile_background_image_url":"http://a0.twimg.com/images/themes/theme1/bg.png",
|
119
|
+
"favourites_count":0,
|
120
|
+
"profile_link_color":"0084B4",
|
121
|
+
"profile_image_url_https":"https://si0.twimg.com/profile_images/2317655970/6o3qtl1efagg8gwqw9vy_normal.jpeg",
|
122
|
+
"notifications":null,
|
123
|
+
"followers_count":18,
|
124
|
+
"protected":false,
|
125
|
+
"screen_name":"_Olivier_D",
|
126
|
+
"follow_request_sent":null,
|
127
|
+
"contributors_enabled":false,
|
128
|
+
"following":null,
|
129
|
+
"time_zone":"Buenos Aires",
|
130
|
+
"profile_background_color":"C0DEED",
|
131
|
+
"name":"Olivier",
|
132
|
+
"profile_background_tile":false,
|
133
|
+
"id":308762265,
|
134
|
+
"is_translator":false,
|
135
|
+
"listed_count":0,
|
136
|
+
"utc_offset":-10800,
|
137
|
+
"profile_sidebar_fill_color":"DDEEF6"
|
138
|
+
},
|
139
|
+
"id":269556600040214528,
|
140
|
+
"in_reply_to_status_id_str":null
|
141
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fetcher-microdata-twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: discoverer
|
@@ -89,19 +89,25 @@ files:
|
|
89
89
|
- LICENSE
|
90
90
|
- README.md
|
91
91
|
- Rakefile
|
92
|
+
- features/stepdefs/translate_retweet_to_schema.rb
|
92
93
|
- features/stepdefs/translate_tweet_to_schema.rb
|
93
94
|
- features/support/env.rb
|
95
|
+
- features/translate_retweet_to_schema.feature
|
94
96
|
- features/translate_tweet_to_schema.feature
|
95
97
|
- features/translate_user_to_schema.feature
|
96
98
|
- fetcher-microdata-twitter.gemspec
|
97
99
|
- lib/fetcher-microdata-twitter.rb
|
98
100
|
- lib/fetcher/microdata/article_small/twitter/coercer.rb
|
99
101
|
- lib/fetcher/microdata/person_user/twitter/coercer.rb
|
102
|
+
- lib/fetcher/microdata/review/twitter/coercer.rb
|
100
103
|
- lib/fetcher/microdata/twitter/service.rb
|
101
104
|
- lib/fetcher/microdata/twitter/version.rb
|
102
105
|
- spec/fetcher/microdata/article_small/twitter/coercer_spec.rb
|
103
106
|
- spec/fetcher/microdata/person_user/twitter/coercer_spec.rb
|
107
|
+
- spec/fetcher/microdata/review/twitter/coercer_spec.rb
|
104
108
|
- spec/fetcher/microdata/twitter/service_spec.rb
|
109
|
+
- spec/original_tweet_that_is_retweeted.json
|
110
|
+
- spec/retweet.json
|
105
111
|
- spec/spec_helper.rb
|
106
112
|
- spec/tweet.json
|
107
113
|
- spec/user.json
|
@@ -119,18 +125,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
125
|
- - ! '>='
|
120
126
|
- !ruby/object:Gem::Version
|
121
127
|
version: '0'
|
122
|
-
segments:
|
123
|
-
- 0
|
124
|
-
hash: -956730701
|
125
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
129
|
none: false
|
127
130
|
requirements:
|
128
131
|
- - ! '>='
|
129
132
|
- !ruby/object:Gem::Version
|
130
133
|
version: '0'
|
131
|
-
segments:
|
132
|
-
- 0
|
133
|
-
hash: -956730701
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
136
|
rubygems_version: 1.8.24
|
@@ -138,13 +138,18 @@ signing_key:
|
|
138
138
|
specification_version: 3
|
139
139
|
summary: Fetcher Microdata adapter for Twitter
|
140
140
|
test_files:
|
141
|
+
- features/stepdefs/translate_retweet_to_schema.rb
|
141
142
|
- features/stepdefs/translate_tweet_to_schema.rb
|
142
143
|
- features/support/env.rb
|
144
|
+
- features/translate_retweet_to_schema.feature
|
143
145
|
- features/translate_tweet_to_schema.feature
|
144
146
|
- features/translate_user_to_schema.feature
|
145
147
|
- spec/fetcher/microdata/article_small/twitter/coercer_spec.rb
|
146
148
|
- spec/fetcher/microdata/person_user/twitter/coercer_spec.rb
|
149
|
+
- spec/fetcher/microdata/review/twitter/coercer_spec.rb
|
147
150
|
- spec/fetcher/microdata/twitter/service_spec.rb
|
151
|
+
- spec/original_tweet_that_is_retweeted.json
|
152
|
+
- spec/retweet.json
|
148
153
|
- spec/spec_helper.rb
|
149
154
|
- spec/tweet.json
|
150
155
|
- spec/user.json
|