zooniverse_social 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zooniverse_social/posts.rb +11 -1
- data/lib/zooniverse_social/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a8508ceb1dd2595c7349fb57e83632e95909d8
|
4
|
+
data.tar.gz: b1fcbbe08b3099d785cf9cdfab2e7fb9497206c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b429864fba8b1fd9b75a93a1a2d57c0e3f9e58a5a8de2c7019807035e5e49a62f5999789b5669ce485c8105f094ef9a4db0180e8548171d4bb1ca1e11494ee9c
|
7
|
+
data.tar.gz: 2ae83334973d68863ee8ba947fb8db20ee2c0737ec9d75321dda89a1aaec611ab12abfe248f00a52c5e1e0727750f6607691253164c21779af056d2a64b2630d
|
@@ -17,15 +17,25 @@ module ZooniverseSocial
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def _update(updater)
|
20
|
-
response = updater.update number: 3, fields: 'ID,URL,title,date'
|
20
|
+
response = updater.update number: 3, fields: 'ID,URL,title,excerpt,date'
|
21
21
|
response.fetch('posts', []).collect do |post|
|
22
22
|
{
|
23
23
|
id: post['ID'],
|
24
24
|
title: post['title'],
|
25
|
+
excerpt: clean_excerpt(post['excerpt']),
|
25
26
|
created_at: post['date'],
|
26
27
|
link: post['URL']
|
27
28
|
}
|
28
29
|
end
|
29
30
|
end
|
31
|
+
|
32
|
+
def clean_excerpt(text)
|
33
|
+
(text || '')
|
34
|
+
.gsub(' ', '')
|
35
|
+
.gsub('[…]', '')
|
36
|
+
.gsub('<p>', '')
|
37
|
+
.gsub('</p>', '')
|
38
|
+
.strip
|
39
|
+
end
|
30
40
|
end
|
31
41
|
end
|