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 +5 -5
- data/.travis.yml +1 -1
- data/lib/zooniverse_social.rb +5 -0
- data/lib/zooniverse_social/posts.rb +12 -6
- data/lib/zooniverse_social/version.rb +1 -1
- data/zooniverse_social.gemspec +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4ce008db4b4194b1f4cef2abd2d73786cfaccb4e64d2e0eb74969cb8dc49e6b0
|
4
|
+
data.tar.gz: a2bf6ef01908a53aaf2f80a922672196fd90ad9e93b842fcffc047c7ad515c69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e05b89fc173c200934bff8258490bccde27d60bc96815880ab2a4a3c2f00290586196d24a8688a8d02241aeaac2b76970d5d97d3a5684ed7488e4f0ac22221c4
|
7
|
+
data.tar.gz: d640f5a9ca446a388b19a281b6e363d2d16563a42bdb5213d0f1b388f1ccc775fcb2347f13729ec8ae433a0558e914ef5a01f026c3b9292a9930bdb844929b74
|
data/.travis.yml
CHANGED
data/lib/zooniverse_social.rb
CHANGED
@@ -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:
|
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
|
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>', '')
|
data/zooniverse_social.gemspec
CHANGED
@@ -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'
|
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
|
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:
|
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: '
|
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: '
|
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
|
-
|
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
|