zooniverse_social 1.1.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/codeql-analysis.yml +72 -0
- data/.github/workflows/run_tests_CI.yml +22 -0
- data/README.md +15 -4
- data/lib/zooniverse_social/data.rb +3 -7
- data/lib/zooniverse_social/version.rb +3 -1
- data/zooniverse_social.gemspec +11 -11
- metadata +51 -65
- data/.travis.yml +0 -7
- 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
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ "master" ]
|
17
|
+
pull_request:
|
18
|
+
schedule:
|
19
|
+
- cron: '26 11 * * 6'
|
20
|
+
|
21
|
+
jobs:
|
22
|
+
analyze:
|
23
|
+
name: Analyze
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
permissions:
|
26
|
+
actions: read
|
27
|
+
contents: read
|
28
|
+
security-events: write
|
29
|
+
|
30
|
+
strategy:
|
31
|
+
fail-fast: false
|
32
|
+
matrix:
|
33
|
+
language: [ 'ruby' ]
|
34
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
35
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
36
|
+
|
37
|
+
steps:
|
38
|
+
- name: Checkout repository
|
39
|
+
uses: actions/checkout@v3
|
40
|
+
|
41
|
+
# Initializes the CodeQL tools for scanning.
|
42
|
+
- name: Initialize CodeQL
|
43
|
+
uses: github/codeql-action/init@v2
|
44
|
+
with:
|
45
|
+
languages: ${{ matrix.language }}
|
46
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
47
|
+
# By default, queries listed here will override any specified in a config file.
|
48
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
49
|
+
|
50
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
51
|
+
# queries: security-extended,security-and-quality
|
52
|
+
|
53
|
+
|
54
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
55
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
56
|
+
- name: Autobuild
|
57
|
+
uses: github/codeql-action/autobuild@v2
|
58
|
+
|
59
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
60
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
61
|
+
|
62
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
63
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
64
|
+
|
65
|
+
# - run: |
|
66
|
+
# echo "Run, Build Application using script"
|
67
|
+
# ./location_of_script_within_repo/buildscript.sh
|
68
|
+
|
69
|
+
- name: Perform CodeQL Analysis
|
70
|
+
uses: github/codeql-action/analyze@v2
|
71
|
+
with:
|
72
|
+
category: "/language:${{matrix.language}}"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Zooni CI
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push: { branches: master }
|
5
|
+
env:
|
6
|
+
RAILS_ENV: test
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
name: Run Tests
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- name: Checkout code
|
13
|
+
uses: actions/checkout@v3
|
14
|
+
|
15
|
+
- name: Setup Ruby and install gems
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: '2.6' # Not needed with a .ruby-version file
|
19
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
20
|
+
|
21
|
+
- name: Run tests
|
22
|
+
run: bundle exec rspec
|
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:
|
@@ -22,10 +20,23 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
### Boot the application
|
24
|
+
Run the app via the rackup cmd, <https://github.com/sinatra/sinatra#serving-a-modular-application>
|
25
|
+
|
26
|
+
`bundle exec rackup -p 4567`
|
27
|
+
|
28
|
+
### Install dependencies
|
29
|
+
`bundle install`
|
30
|
+
|
31
|
+
### Test the app
|
32
|
+
`bundle exec rspec`
|
33
|
+
|
34
|
+
### Publishing to [RubyGems](https://rubygems.org/)
|
35
|
+
`rake build` - to create the new gem version locally
|
36
|
+
`rake release` - to tag the gem and release it to RubyGems
|
26
37
|
|
27
38
|
## License
|
28
39
|
|
29
|
-
Copyright
|
40
|
+
Copyright 2023 by the Zooniverse
|
30
41
|
|
31
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', '~> 1.4'
|
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
|
-
spec.add_development_dependency 'bundler'
|
30
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.4'
|
32
|
-
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
33
|
-
spec.add_development_dependency 'rack-test', '~> 0.6'
|
34
|
-
spec.add_development_dependency 'webmock', '~> 2.1'
|
29
|
+
spec.add_development_dependency 'bundler'
|
35
30
|
spec.add_development_dependency 'pry'
|
31
|
+
spec.add_development_dependency 'rack-test'
|
32
|
+
spec.add_development_dependency 'rake'
|
33
|
+
spec.add_development_dependency 'rspec'
|
34
|
+
spec.add_development_dependency 'rspec-its'
|
35
|
+
spec.add_development_dependency 'webmock'
|
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.1
|
4
|
+
version: 1.3.1
|
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: 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: '1.
|
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: '1.
|
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,119 +53,119 @@ 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
|
100
86
|
requirements:
|
101
|
-
- - "
|
87
|
+
- - ">="
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- - "
|
94
|
+
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
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
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
103
|
+
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- - "
|
108
|
+
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
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
|
+
- - ">="
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
117
|
+
version: '0'
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
|
-
- - "
|
122
|
+
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
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
|
+
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
131
|
+
version: '0'
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
|
-
- - "
|
136
|
+
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
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
|
+
- - ">="
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version: '0
|
145
|
+
version: '0'
|
160
146
|
type: :development
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
|
-
- - "
|
150
|
+
- - ">="
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0
|
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
|
+
- - ">="
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
159
|
+
version: '0'
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
|
-
- - "
|
164
|
+
- - ">="
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
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
|
- - ">="
|
@@ -199,9 +185,10 @@ executables: []
|
|
199
185
|
extensions: []
|
200
186
|
extra_rdoc_files: []
|
201
187
|
files:
|
188
|
+
- ".github/workflows/codeql-analysis.yml"
|
189
|
+
- ".github/workflows/run_tests_CI.yml"
|
202
190
|
- ".gitignore"
|
203
191
|
- ".rspec"
|
204
|
-
- ".travis.yml"
|
205
192
|
- Gemfile
|
206
193
|
- LICENSE
|
207
194
|
- README.md
|
@@ -215,7 +202,6 @@ files:
|
|
215
202
|
- lib/zooniverse_social/server.rb
|
216
203
|
- lib/zooniverse_social/statuses.rb
|
217
204
|
- lib/zooniverse_social/task_observer.rb
|
218
|
-
- lib/zooniverse_social/tweets.rb
|
219
205
|
- lib/zooniverse_social/updater.rb
|
220
206
|
- lib/zooniverse_social/version.rb
|
221
207
|
- zooniverse_social.gemspec
|
@@ -238,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
224
|
- !ruby/object:Gem::Version
|
239
225
|
version: '0'
|
240
226
|
requirements: []
|
241
|
-
rubygems_version: 3.
|
227
|
+
rubygems_version: 3.1.4
|
242
228
|
signing_key:
|
243
229
|
specification_version: 4
|
244
230
|
summary: Social media aggregation service for the Zooniverse
|
data/.travis.yml
DELETED
@@ -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
|