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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13a2b48e21b016642a4fc5ee321082084e424f93
4
- data.tar.gz: 90908c8d750ae473e6951f088a244e7b44778fe7
3
+ metadata.gz: 02a8508ceb1dd2595c7349fb57e83632e95909d8
4
+ data.tar.gz: b1fcbbe08b3099d785cf9cdfab2e7fb9497206c8
5
5
  SHA512:
6
- metadata.gz: 6af3d0f32ac2faf03c188bb314b2ebf0fbd4e71d04f96ca2446765aad13d17e9bf3c25d1530e15504699d11b0190848697c17dcd6210451cbeaeb2dbc009ad83
7
- data.tar.gz: f55785f82c04bf4a199a57772f99bd502e181e92332b4793e5a3d4ab9ba5fed4678a692b72ff475d53a3e2aeaffaf149e70b4fc9549efcae58049725d8934df3
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
@@ -1,3 +1,3 @@
1
1
  module ZooniverseSocial
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zooniverse_social
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Parrish