gnip_api 0.0.2 → 0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gnip_api/gnip/url.rb +1 -1
- data/lib/gnip_api/version.rb +1 -1
- data/spec/fixtures/activities/nil_urls2.json +1 -0
- data/spec/gnip_api/gnip/gnip_data_spec.rb +17 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30453afea5af2169290ebd12fea604202c5b6a6a
|
4
|
+
data.tar.gz: b08163b715a94d679ea8e91e71de2de46b77de9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0917aee021bedecdb4e7757e10d9d6e9d98d091b6c360be6b6f7c708c8f0ddccee460f4695ac596f51973f6e7d348de3868fd60b3dcbc24093dc00e5887024
|
7
|
+
data.tar.gz: 2dec8144d33e7e366c5dacc865ebb71d98cf4a88e5ead30d7c308060e7e79a795098acf652f928cae5e4719fe01f2790462d7c90c050680710d3bb528c41bc9c
|
data/Gemfile.lock
CHANGED
data/lib/gnip_api/gnip/url.rb
CHANGED
data/lib/gnip_api/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"id":"tag:search.twitter.com,2005:753160349944197120","objectType":"activity","actor":{"objectType":"person","id":"id:twitter.com:3224498552","link":"http://www.twitter.com/actually_miguel","displayName":"lil Migo⁶","postedTime":"2015-05-23T18:08:54.000Z","image":"https://pbs.twimg.com/profile_images/753157176974200833/devZQpcw_normal.jpg","summary":null,"links":[{"href":null,"rel":"me"}],"friendsCount":216,"followersCount":241,"listedCount":0,"statusesCount":3112,"twitterTimeZone":null,"verified":false,"utcOffset":null,"preferredUsername":"actually_miguel","languages":["en"],"location":null,"favoritesCount":3489},"verb":"post","postedTime":"2016-07-13T09:33:15.000Z","generator":{"displayName":"Twitter for iPhone","link":"http://twitter.com/download/iphone"},"provider":{"objectType":"service","displayName":"Twitter","link":"http://www.twitter.com"},"link":"http://twitter.com/actually_miguel/statuses/753160349944197120","body":"THIS IS WHY I DONT FUCK WITH POKEMON GO AT NIGHT https://t.co/PYsldvNKd6","object":{"objectType":"note","id":"object:search.twitter.com,2005:753160349944197120","summary":"THIS IS WHY I DONT FUCK WITH POKEMON GO AT NIGHT https://t.co/PYsldvNKd6","link":"http://twitter.com/actually_miguel/statuses/753160349944197120","postedTime":"2016-07-13T09:33:15.000Z"},"favoritesCount":0,"twitter_entities":{"hashtags":[],"urls":[],"user_mentions":[],"symbols":[],"media":[{"id":753160344546062337,"id_str":"753160344546062337","indices":[49,72],"media_url":"http://pbs.twimg.com/media/CnPDV8uUMAE3RqQ.jpg","media_url_https":"https://pbs.twimg.com/media/CnPDV8uUMAE3RqQ.jpg","url":"https://t.co/PYsldvNKd6","display_url":"pic.twitter.com/PYsldvNKd6","expanded_url":"http://twitter.com/actually_miguel/status/753160349944197120/photo/1","type":"photo","sizes":{"small":{"w":382,"h":680,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"medium":{"w":675,"h":1200,"resize":"fit"},"large":{"w":750,"h":1334,"resize":"fit"}}}]},"twitter_filter_level":"low","twitter_lang":"en","retweetCount":0,"gnip":{"matching_rules":[{"tag":"25809"}],"urls":[{"url":"https://t.co/PYsldvNKd6"}],"language":{"value":"en"}}}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Gnip::GnipData do
|
4
|
-
context 'when urls have nil' do
|
4
|
+
context 'when all urls have nil' do
|
5
5
|
before do
|
6
6
|
@activity = File.read(fixture_path.join('activities', 'nil_urls.json'))
|
7
7
|
@activity = JSON.parse(@activity)
|
@@ -17,6 +17,22 @@ describe Gnip::GnipData do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
context 'when expanded urls have nil' do
|
21
|
+
before do
|
22
|
+
@activity = File.read(fixture_path.join('activities', 'nil_urls2.json'))
|
23
|
+
@activity = JSON.parse(@activity)
|
24
|
+
@gnip = Gnip::GnipData.new(@activity['gnip'])
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'does not fail using expanded urls' do
|
28
|
+
expect(Proc.new{@gnip.urls.first.expanded_url}).not_to raise_error
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'does not fail using expanded urls' do
|
32
|
+
expect(Proc.new{@gnip.urls.first.url}).not_to raise_error
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
20
36
|
context 'with long rules' do
|
21
37
|
before do
|
22
38
|
@activity = File.read(fixture_path.join('activities', 'real_activity_long_rules.json'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gnip_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rayko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- lib/gnip_api/version.rb
|
182
182
|
- spec/fixtures/activities/full_activity.json
|
183
183
|
- spec/fixtures/activities/nil_urls.json
|
184
|
+
- spec/fixtures/activities/nil_urls2.json
|
184
185
|
- spec/fixtures/activities/real_activity.json
|
185
186
|
- spec/fixtures/activities/real_activity_long_rules.json
|
186
187
|
- spec/fixtures/system_messages/error.json
|
@@ -246,6 +247,7 @@ summary: GnipApi provides exposes all Gnip APIs.
|
|
246
247
|
test_files:
|
247
248
|
- spec/fixtures/activities/full_activity.json
|
248
249
|
- spec/fixtures/activities/nil_urls.json
|
250
|
+
- spec/fixtures/activities/nil_urls2.json
|
249
251
|
- spec/fixtures/activities/real_activity.json
|
250
252
|
- spec/fixtures/activities/real_activity_long_rules.json
|
251
253
|
- spec/fixtures/system_messages/error.json
|