zooniverse_social 1.0.2 → 1.1.0

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
- SHA1:
3
- metadata.gz: 02a8508ceb1dd2595c7349fb57e83632e95909d8
4
- data.tar.gz: b1fcbbe08b3099d785cf9cdfab2e7fb9497206c8
2
+ SHA256:
3
+ metadata.gz: 4ce008db4b4194b1f4cef2abd2d73786cfaccb4e64d2e0eb74969cb8dc49e6b0
4
+ data.tar.gz: a2bf6ef01908a53aaf2f80a922672196fd90ad9e93b842fcffc047c7ad515c69
5
5
  SHA512:
6
- metadata.gz: b429864fba8b1fd9b75a93a1a2d57c0e3f9e58a5a8de2c7019807035e5e49a62f5999789b5669ce485c8105f094ef9a4db0180e8548171d4bb1ca1e11494ee9c
7
- data.tar.gz: 2ae83334973d68863ee8ba947fb8db20ee2c0737ec9d75321dda89a1aaec611ab12abfe248f00a52c5e1e0727750f6607691253164c21779af056d2a64b2630d
6
+ metadata.gz: e05b89fc173c200934bff8258490bccde27d60bc96815880ab2a4a3c2f00290586196d24a8688a8d02241aeaac2b76970d5d97d3a5684ed7488e4f0ac22221c4
7
+ data.tar.gz: d640f5a9ca446a388b19a281b6e363d2d16563a42bdb5213d0f1b388f1ccc775fcb2347f13729ec8ae433a0558e914ef5a01f026c3b9292a9930bdb844929b74
@@ -3,5 +3,5 @@ sudo: false
3
3
  cache:
4
4
  - bundler
5
5
  rvm:
6
- - 2.3.1
6
+ - 2.6
7
7
  script: bundle exec rspec
@@ -1,4 +1,9 @@
1
1
  module ZooniverseSocial
2
2
  require 'zooniverse_social/version'
3
3
  require 'zooniverse_social/server'
4
+ require 'zooniverse_social/data'
5
+
6
+ def self.start
7
+ Data.start
8
+ end
4
9
  end
@@ -1,3 +1,4 @@
1
+ require 'cgi'
1
2
  require 'zooniverse_social/updater'
2
3
 
3
4
  module ZooniverseSocial
@@ -17,20 +18,25 @@ module ZooniverseSocial
17
18
  end
18
19
 
19
20
  def _update(updater)
20
- response = updater.update number: 3, fields: 'ID,URL,title,excerpt,date'
21
+ response = updater.update number: 3, fields: 'ID,URL,title,excerpt,date,featured_image'
21
22
  response.fetch('posts', []).collect do |post|
22
23
  {
23
24
  id: post['ID'],
24
- title: post['title'],
25
- excerpt: clean_excerpt(post['excerpt']),
25
+ title: remove_entities(post['title']),
26
+ excerpt: remove_entities(post['excerpt']),
26
27
  created_at: post['date'],
27
- link: post['URL']
28
+ link: post['URL'],
29
+ image: post['featured_image']
28
30
  }
29
31
  end
30
32
  end
31
33
 
32
- def clean_excerpt(text)
33
- (text || '')
34
+ def remove_entities(text)
35
+ CGI.unescapeHTML (text || '')
36
+ .gsub('’', '\'')
37
+ .gsub('“', '"')
38
+ .gsub('”', '"')
39
+ .gsub('&', '&')
34
40
  .gsub(' ', '')
35
41
  .gsub('[…]', '')
36
42
  .gsub('<p>', '')
@@ -1,3 +1,3 @@
1
1
  module ZooniverseSocial
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_runtime_dependency 'puma', '~> 3.2'
22
+ spec.add_runtime_dependency 'puma'
23
23
  spec.add_runtime_dependency 'sinatra', '~> 1.4'
24
24
  spec.add_runtime_dependency 'twitter', '~> 5.16'
25
25
  spec.add_runtime_dependency 'faraday', '~> 0.9'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zooniverse_social
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Parrish
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-26 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinatra
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -238,8 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubyforge_project:
242
- rubygems_version: 2.5.1
241
+ rubygems_version: 3.0.3
243
242
  signing_key:
244
243
  specification_version: 4
245
244
  summary: Social media aggregation service for the Zooniverse