zooniverse_social 1.2.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/run_tests_CI.yml +1 -1
- data/README.md +1 -3
- data/lib/zooniverse_social/data.rb +3 -7
- data/lib/zooniverse_social/version.rb +3 -1
- data/zooniverse_social.gemspec +7 -7
- metadata +30 -45
- data/lib/zooniverse_social/tweets.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8068068ee1f38f16d374e9eda758ffa0b835a1fd415f791d4a78d48174fe7cb6
|
4
|
+
data.tar.gz: 2ce365a670b94033f77abd0d320234840b7950da921e4bb45577f4b7f50b8dd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a591f2a3cb8970eddc81da79d0f22cab27636071ce753c6829c8206dfaf4365d74f2d06aacd4d91a56cd428babbb6cee89f9576ead8281aae145681185d519
|
7
|
+
data.tar.gz: f17ab480c28e3110409c175ccd6639f1e97ddae0e14676527885266389a5346db766ab2e643b60d51a2d7d8f89e3ec174cf042dfa11d7f51e0e05e69d9ce9c18
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
Social media aggregation service for the Zooniverse
|
4
4
|
|
5
|
-
[![Build Status](https://travis-ci.org/zooniverse/Social.svg?branch=master)](https://travis-ci.org/zooniverse/Social)
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
@@ -39,6 +37,6 @@ Run the app via the rackup cmd, <https://github.com/sinatra/sinatra#serving-a-mo
|
|
39
37
|
|
40
38
|
## License
|
41
39
|
|
42
|
-
Copyright
|
40
|
+
Copyright 2023 by the Zooniverse
|
43
41
|
|
44
42
|
The gem is available as open source under the terms of the [Apache License v2](https://opensource.org/licenses/Apache-2.0).
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'concurrent'
|
2
4
|
|
3
5
|
require 'zooniverse_social/posts'
|
4
6
|
require 'zooniverse_social/statuses'
|
5
|
-
require 'zooniverse_social/tweets'
|
6
7
|
require 'zooniverse_social/task_observer'
|
7
8
|
|
8
9
|
module ZooniverseSocial
|
@@ -11,22 +12,17 @@ module ZooniverseSocial
|
|
11
12
|
@posts ||= Posts.new
|
12
13
|
end
|
13
14
|
|
14
|
-
def self.tweets
|
15
|
-
@tweets ||= Tweets.new
|
16
|
-
end
|
17
|
-
|
18
15
|
def self.statuses
|
19
16
|
@statuses ||= Statuses.new
|
20
17
|
end
|
21
18
|
|
22
19
|
def self.sources
|
23
|
-
[posts,
|
20
|
+
[posts, statuses]
|
24
21
|
end
|
25
22
|
|
26
23
|
def self.current
|
27
24
|
{
|
28
25
|
posts: posts.data,
|
29
|
-
tweets: tweets.data,
|
30
26
|
statuses: statuses.data
|
31
27
|
}
|
32
28
|
end
|
data/zooniverse_social.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'zooniverse_social/version'
|
@@ -19,18 +20,17 @@ Gem::Specification.new do |spec|
|
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
21
|
spec.require_paths = ['lib']
|
21
22
|
|
22
|
-
spec.add_runtime_dependency 'puma'
|
23
|
-
spec.add_runtime_dependency 'sinatra', '>= 2.2'
|
24
|
-
spec.add_runtime_dependency 'twitter', '~> 5.16'
|
25
|
-
spec.add_runtime_dependency 'faraday', '~> 0.9'
|
26
23
|
spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
|
27
24
|
spec.add_runtime_dependency 'concurrent-ruby-ext', '~> 1.0'
|
25
|
+
spec.add_runtime_dependency 'faraday', '~> 0.9'
|
26
|
+
spec.add_runtime_dependency 'puma'
|
27
|
+
spec.add_runtime_dependency 'sinatra', '>= 2.2'
|
28
28
|
|
29
29
|
spec.add_development_dependency 'bundler'
|
30
|
+
spec.add_development_dependency 'pry'
|
31
|
+
spec.add_development_dependency 'rack-test'
|
30
32
|
spec.add_development_dependency 'rake'
|
31
33
|
spec.add_development_dependency 'rspec'
|
32
34
|
spec.add_development_dependency 'rspec-its'
|
33
|
-
spec.add_development_dependency 'rack-test'
|
34
35
|
spec.add_development_dependency 'webmock'
|
35
|
-
spec.add_development_dependency 'pry'
|
36
36
|
end
|
metadata
CHANGED
@@ -1,57 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zooniverse_social
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: sinatra
|
14
|
+
name: concurrent-ruby
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - "
|
17
|
+
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '1.0'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - "
|
24
|
+
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '1.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
28
|
+
name: concurrent-ruby-ext
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
33
|
+
version: '1.0'
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
40
|
+
version: '1.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: faraday
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,33 +53,33 @@ dependencies:
|
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0.9'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: puma
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
61
|
+
version: '0'
|
76
62
|
type: :runtime
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
68
|
+
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: sinatra
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '2.2'
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '2.2'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: bundler
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +95,7 @@ dependencies:
|
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
98
|
+
name: pry
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
@@ -123,7 +109,7 @@ dependencies:
|
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: rack-test
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - ">="
|
@@ -137,7 +123,7 @@ dependencies:
|
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
126
|
+
name: rake
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - ">="
|
@@ -151,7 +137,7 @@ dependencies:
|
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
140
|
+
name: rspec
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
143
|
- - ">="
|
@@ -165,7 +151,7 @@ dependencies:
|
|
165
151
|
- !ruby/object:Gem::Version
|
166
152
|
version: '0'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
154
|
+
name: rspec-its
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
157
|
- - ">="
|
@@ -179,7 +165,7 @@ dependencies:
|
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '0'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
168
|
+
name: webmock
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
171
|
- - ">="
|
@@ -216,7 +202,6 @@ files:
|
|
216
202
|
- lib/zooniverse_social/server.rb
|
217
203
|
- lib/zooniverse_social/statuses.rb
|
218
204
|
- lib/zooniverse_social/task_observer.rb
|
219
|
-
- lib/zooniverse_social/tweets.rb
|
220
205
|
- lib/zooniverse_social/updater.rb
|
221
206
|
- lib/zooniverse_social/version.rb
|
222
207
|
- zooniverse_social.gemspec
|
@@ -224,7 +209,7 @@ homepage: https://github.com/zooniverse/Social
|
|
224
209
|
licenses:
|
225
210
|
- Apache 2
|
226
211
|
metadata: {}
|
227
|
-
post_install_message:
|
212
|
+
post_install_message:
|
228
213
|
rdoc_options: []
|
229
214
|
require_paths:
|
230
215
|
- lib
|
@@ -239,8 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
224
|
- !ruby/object:Gem::Version
|
240
225
|
version: '0'
|
241
226
|
requirements: []
|
242
|
-
rubygems_version: 3.
|
243
|
-
signing_key:
|
227
|
+
rubygems_version: 3.1.4
|
228
|
+
signing_key:
|
244
229
|
specification_version: 4
|
245
230
|
summary: Social media aggregation service for the Zooniverse
|
246
231
|
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'twitter'
|
2
|
-
|
3
|
-
module ZooniverseSocial
|
4
|
-
class Tweets
|
5
|
-
attr_reader :data
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@twitter = Twitter::REST::Client.new({
|
9
|
-
consumer_key: ENV.fetch('TWITTER_KEY'),
|
10
|
-
consumer_secret: ENV.fetch('TWITTER_SECRET')
|
11
|
-
})
|
12
|
-
|
13
|
-
update
|
14
|
-
end
|
15
|
-
|
16
|
-
def update
|
17
|
-
@data = @twitter.search('from:the_zooniverse', result_type: 'recent').take(3).collect do |tweet|
|
18
|
-
tweet.to_h.tap do |hash|
|
19
|
-
appended = hash.dig :entities, :urls, 0, :url
|
20
|
-
hash[:text].sub!(/\s?#{ appended }/, '') if appended
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|