social_feed_agregator 0.0.5 → 0.0.6
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/lib/social_feed_agregator/facebook_reader.rb +8 -0
- data/lib/social_feed_agregator/googleplus_reader.rb +11 -2
- data/lib/social_feed_agregator/pinterest_reader.rb +8 -1
- data/lib/social_feed_agregator/twitter_reader.rb +9 -1
- data/lib/social_feed_agregator/version.rb +1 -1
- data/social_feed_agregator.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c11cb061c2e0d74e00f2776a0e9227460ed390f
|
4
|
+
data.tar.gz: e316e1089caa02958cdb48a81a8457fb12d72e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17d8d29b0658c003c11f7abbcda8466df4b1d298a570da5bfe52ed322866daa1855d0e774c6015dfb00aec4eb83412aec68b8f57bc78b109bcf689785cdfdd8
|
7
|
+
data.tar.gz: e5fbd8a1e14f60e6ef19a0695848e7c6e7c0c01a7c2c4619a7de224b5c66641f72f64d4af7b509a650bc64df549fd0919579d57247afac264252c1439b7badd3
|
@@ -20,6 +20,8 @@ module SocialFeedAgregator
|
|
20
20
|
super(options)
|
21
21
|
@name = options[:name] if options[:name]
|
22
22
|
count = options[:count] || 25
|
23
|
+
|
24
|
+
from_date = options[:from_date] || DateTime.new(1970,1,1)
|
23
25
|
|
24
26
|
feeds, i, count_per_request, items = [], 0, 25, 0
|
25
27
|
|
@@ -35,6 +37,12 @@ module SocialFeedAgregator
|
|
35
37
|
items+=1
|
36
38
|
break if items > count
|
37
39
|
|
40
|
+
# Break if the date is less
|
41
|
+
if DateTime.parse(post['created_time']) <= from_date
|
42
|
+
i = parts
|
43
|
+
break
|
44
|
+
end
|
45
|
+
|
38
46
|
feed = fill_feed post
|
39
47
|
|
40
48
|
block_given? ? yield(feed) : feeds << feed
|
@@ -18,6 +18,8 @@ module SocialFeedAgregator
|
|
18
18
|
super(options)
|
19
19
|
@user_id = options[:user_id] if options[:user_id]
|
20
20
|
count = options[:count] || 25
|
21
|
+
|
22
|
+
from_date = options[:from_date] || DateTime.new(1970,1,1)
|
21
23
|
|
22
24
|
feeds, i, count_per_request, items = [], 0, 100, 0
|
23
25
|
|
@@ -36,6 +38,12 @@ module SocialFeedAgregator
|
|
36
38
|
items+=1
|
37
39
|
break if items > count
|
38
40
|
|
41
|
+
# Break if the date is less
|
42
|
+
if DateTime.parse(post["published"]) <= from_date
|
43
|
+
i = parts
|
44
|
+
break
|
45
|
+
end
|
46
|
+
|
39
47
|
feed = fill_feed post
|
40
48
|
|
41
49
|
block_given? ? yield(feed) : feeds << feed
|
@@ -66,9 +74,10 @@ module SocialFeedAgregator
|
|
66
74
|
user_name: post['actor']['displayName'],
|
67
75
|
|
68
76
|
permalink: post['url'],
|
69
|
-
|
77
|
+
message: post['object']['content'],
|
78
|
+
# description: post['object']['content'],
|
70
79
|
|
71
|
-
name: post['title'],
|
80
|
+
# name: post['title'],
|
72
81
|
|
73
82
|
picture_url: picture_url,
|
74
83
|
link: link,
|
@@ -16,6 +16,8 @@ module SocialFeedAgregator
|
|
16
16
|
super(options)
|
17
17
|
@name = options[:name] if options[:name]
|
18
18
|
count = options[:count] || 25
|
19
|
+
from_date = options[:from_date] || DateTime.new(1970,1,1)
|
20
|
+
|
19
21
|
feeds = []
|
20
22
|
items = 0
|
21
23
|
|
@@ -25,6 +27,11 @@ module SocialFeedAgregator
|
|
25
27
|
items += 1
|
26
28
|
break if items > count
|
27
29
|
|
30
|
+
# Break if the date is less
|
31
|
+
if DateTime.parse(item.xpath('pubDate').inner_text) <= from_date
|
32
|
+
break
|
33
|
+
end
|
34
|
+
|
28
35
|
feed = fill_feed item
|
29
36
|
|
30
37
|
block_given? ? yield(feed) : feeds << feed
|
@@ -44,7 +51,7 @@ module SocialFeedAgregator
|
|
44
51
|
user_id: @name,
|
45
52
|
user_name: @name,
|
46
53
|
|
47
|
-
name: item.xpath('title').inner_text,
|
54
|
+
# name: item.xpath('title').inner_text,
|
48
55
|
permalink: item.xpath('link').inner_text,
|
49
56
|
picture_url: desc[1],
|
50
57
|
description: desc[2],
|
@@ -26,7 +26,9 @@ module SocialFeedAgregator
|
|
26
26
|
def get_feeds(options={})
|
27
27
|
super(options)
|
28
28
|
@name = options[:name] if options[:name]
|
29
|
-
count = options[:count] ||
|
29
|
+
count = options[:count] || 100
|
30
|
+
|
31
|
+
from_date = options[:from_date] || DateTime.new(1970,1,1)
|
30
32
|
|
31
33
|
client = ::Twitter.configure do |config|
|
32
34
|
config.consumer_key = @consumer_key
|
@@ -47,6 +49,12 @@ module SocialFeedAgregator
|
|
47
49
|
|
48
50
|
statuses.each do |status|
|
49
51
|
|
52
|
+
# Break if the date is less
|
53
|
+
if status.created_at <= from_date
|
54
|
+
i = parts
|
55
|
+
break
|
56
|
+
end
|
57
|
+
|
50
58
|
feed = fill_feed status
|
51
59
|
|
52
60
|
block_given? ? yield(feed) : feeds << feed
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_feed_agregator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Sobolev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.8.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: twitter-text
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.6.1
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.6.1
|
111
125
|
description: Social Feed Agregator
|
112
126
|
email:
|
113
127
|
- eus@appfellas.co
|