k_sequencing 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -4
- data/README.md +25 -8
- data/k_sequencing.gemspec +2 -2
- data/lib/k_sequencing/client.rb +9 -6
- data/lib/k_sequencing/image_choices.rb +5 -5
- data/lib/k_sequencing/image_closed_questions.rb +6 -6
- data/lib/k_sequencing/image_messages.rb +5 -5
- data/lib/k_sequencing/image_photo_tags.rb +5 -5
- data/lib/k_sequencing/predictions.rb +5 -5
- data/lib/k_sequencing/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8844c4dbddcc2f01026504bb564a2a7d5b5d5b7
|
4
|
+
data.tar.gz: 342f4caadd802cc800612fc633be3a4f8085cad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93397e2351ecffc47cbeb60ea09d80c46f34d0401c34c3a992e27703cf7880a204593342c1718236cf6fe29bb5b64ac8d93407fe24594eff460bd7638fdaad42
|
7
|
+
data.tar.gz: 99672fc17e7dc433335171a6dc0405a1173fc36ac399385e68123655c7e33f1c86e9a60c03eddd48e48eabcd56f978c0c50da04eae001b15d2514d3ded8cd257
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
k_sequencing (0.1.
|
4
|
+
k_sequencing (0.1.23)
|
5
5
|
faraday (~> 0.13.1, >= 0.13.1)
|
6
6
|
faraday_middleware (~> 0.12.2, >= 0.12.2)
|
7
7
|
json (~> 1.8, >= 1.8.3)
|
@@ -21,6 +21,3 @@ PLATFORMS
|
|
21
21
|
|
22
22
|
DEPENDENCIES
|
23
23
|
k_sequencing!
|
24
|
-
|
25
|
-
BUNDLED WITH
|
26
|
-
1.15.4
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Image and content moderation services.
|
2
2
|
|
3
3
|
|
4
|
-
## There are 5 avalable for API
|
4
|
+
## There are 5 avalable for API
|
5
5
|
* Closed questions - Answer can be only approved, declined or ban(kenta).
|
6
6
|
* Choices - This model use to ask question with multiple choice. Anwser can be one or multiple.
|
7
7
|
* Photo tags - This model use to create a selection area to find where answer is, by drag the area on image from webpage.
|
@@ -14,9 +14,9 @@
|
|
14
14
|
|
15
15
|
## Getting Started
|
16
16
|
|
17
|
-
KSequencing 0.1.
|
17
|
+
KSequencing 0.1.23 works with Rails 4.1 onwards. You can add it to your Gemfile with:
|
18
18
|
```ruby
|
19
|
-
gem 'k_sequencing'
|
19
|
+
gem 'k_sequencing', '~> 0.1.23'
|
20
20
|
```
|
21
21
|
Then run bundle install
|
22
22
|
|
@@ -88,6 +88,23 @@ KSequencing.[model].find_by({
|
|
88
88
|
}
|
89
89
|
```
|
90
90
|
<Enter>
|
91
|
+
#### Get image by id
|
92
|
+
```ruby
|
93
|
+
KSequencing.client.find_image(id)
|
94
|
+
```
|
95
|
+
|
96
|
+
| Field | Type | Required | Description |
|
97
|
+
| ------------- |:-------------:| :----:| :-----|
|
98
|
+
| token | string | Yes | Project token |
|
99
|
+
| id | string | Yes | Image id or Client's image id|
|
100
|
+
|
101
|
+
###### Sample request
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
KSequencing.client.find_image("59311194e99991b2ca8979f1")
|
105
|
+
KSequencing.client.find_image("your custom id")
|
106
|
+
KSequencing.client.find_image("59311194e99991b2ca8979f1", { token: "[you_token]" })
|
107
|
+
```
|
91
108
|
---
|
92
109
|
#### Create images
|
93
110
|
|
@@ -97,11 +114,11 @@ KSequencing.[model].create()
|
|
97
114
|
|
98
115
|
| Field | Type | Required | Description |
|
99
116
|
| ------------- |:-------------:| :-----:| :-----|
|
100
|
-
|token
|
101
|
-
| data
|
102
|
-
| postback_url
|
103
|
-
| postback_method
|
104
|
-
| custom_id
|
117
|
+
| token | string | Yes | Project token |
|
118
|
+
| data | string | Yes |Data for moderate|
|
119
|
+
| postback_url | string | No | Image postback url|
|
120
|
+
| postback_method | string | No |Postback method|
|
121
|
+
| custom_id | string | No |Custom's id|
|
105
122
|
|
106
123
|
###### Sample request
|
107
124
|
|
data/k_sequencing.gemspec
CHANGED
@@ -5,8 +5,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'k_sequencing'
|
8
|
-
s.version = '0.1.
|
9
|
-
s.date = '2017-
|
8
|
+
s.version = '0.1.23'
|
9
|
+
s.date = '2017-11-23'
|
10
10
|
s.summary = 'KSequencing is a moderator service for your online content'
|
11
11
|
s.description = 'Moderation suite'
|
12
12
|
s.post_install_message = File.read('INSTALL.md') if File.exist?('INSTALL.md')
|
data/lib/k_sequencing/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module KSequencing
|
2
2
|
# :nodoc:
|
3
3
|
class Client
|
4
|
+
|
4
5
|
def create_image_choices(options = {})
|
5
6
|
options[:token] ||= KSequencing.project_key
|
6
7
|
connection.post('/api/images/choices', options)
|
@@ -26,7 +27,6 @@ module KSequencing
|
|
26
27
|
connection.post('/api/prime/predictions', options)
|
27
28
|
end
|
28
29
|
|
29
|
-
|
30
30
|
# -------------------------------- list data ----------------------------------
|
31
31
|
def get_image_choice(options = {})
|
32
32
|
options[:token] ||= KSequencing.project_key
|
@@ -50,10 +50,9 @@ module KSequencing
|
|
50
50
|
|
51
51
|
def get_prediction(options = {})
|
52
52
|
options[:token] ||= KSequencing.project_key
|
53
|
-
connection.get('/api/prime/predictions'
|
53
|
+
connection.get('/api/prime/predictions', options)
|
54
54
|
end
|
55
55
|
|
56
|
-
|
57
56
|
# ------------------------------ find by id -------------------------------
|
58
57
|
def find_by_id_image_choice(options = {})
|
59
58
|
options[:token] ||= KSequencing.project_key
|
@@ -75,17 +74,21 @@ module KSequencing
|
|
75
74
|
connection.get('/api/images/photo_tag', options)
|
76
75
|
end
|
77
76
|
|
78
|
-
def find_by_id_prediction(options = {}
|
77
|
+
def find_by_id_prediction(id, options = {})
|
79
78
|
options[:token] ||= KSequencing.project_key
|
80
79
|
connection.get("/api/prime/predictions/#{id}", options)
|
81
80
|
end
|
82
81
|
|
82
|
+
def find_image(id, options = {})
|
83
|
+
options[:token] ||= KSequencing.project_key
|
84
|
+
connection.get("/api/projects/images/#{id}", options)
|
85
|
+
end
|
83
86
|
|
84
|
-
|
85
|
-
private
|
87
|
+
private
|
86
88
|
|
87
89
|
def connection
|
88
90
|
@connection ||= Connection.new
|
89
91
|
end
|
92
|
+
|
90
93
|
end
|
91
94
|
end
|
@@ -2,14 +2,14 @@ module KSequencing
|
|
2
2
|
# :nodoc:
|
3
3
|
class ImageChoice
|
4
4
|
|
5
|
-
def
|
5
|
+
def all(options = {})
|
6
6
|
options[:token] ||= KSequencing.project_key
|
7
|
-
connection.
|
7
|
+
connection.get('/api/images/choices', options)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def create(options = {})
|
11
11
|
options[:token] ||= KSequencing.project_key
|
12
|
-
connection.
|
12
|
+
connection.post('/api/images/choices', options)
|
13
13
|
end
|
14
14
|
|
15
15
|
def find_by(options = {})
|
@@ -17,7 +17,7 @@ module KSequencing
|
|
17
17
|
connection.get('/api/images/choice', options)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
private
|
21
21
|
|
22
22
|
def connection
|
23
23
|
@connection ||= Connection.new
|
@@ -2,6 +2,11 @@ module KSequencing
|
|
2
2
|
# :nodoc:
|
3
3
|
class ImageClosedQuestion
|
4
4
|
|
5
|
+
def all(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.get('/api/images/closed_questions', options)
|
8
|
+
end
|
9
|
+
|
5
10
|
def create(options = {})
|
6
11
|
options[:token] ||= KSequencing.project_key
|
7
12
|
connection.post('/api/images/closed_questions', options)
|
@@ -12,12 +17,7 @@ module KSequencing
|
|
12
17
|
connection.get('/api/images/closed_question', options)
|
13
18
|
end
|
14
19
|
|
15
|
-
|
16
|
-
options[:token] ||= KSequencing.project_key
|
17
|
-
connection.get('/api/images/closed_questions', options)
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
20
|
+
private
|
21
21
|
|
22
22
|
def connection
|
23
23
|
@connection ||= Connection.new
|
@@ -2,14 +2,14 @@ module KSequencing
|
|
2
2
|
# :nodoc:
|
3
3
|
class ImageMessage
|
4
4
|
|
5
|
-
def
|
5
|
+
def all(options = {})
|
6
6
|
options[:token] ||= KSequencing.project_key
|
7
|
-
connection.
|
7
|
+
connection.get('/api/images/messages', options)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def create(options = {})
|
11
11
|
options[:token] ||= KSequencing.project_key
|
12
|
-
connection.
|
12
|
+
connection.post('/api/images/messages', options)
|
13
13
|
end
|
14
14
|
|
15
15
|
def find_by(options = {})
|
@@ -17,7 +17,7 @@ module KSequencing
|
|
17
17
|
connection.get('/api/images/message', options)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
private
|
21
21
|
|
22
22
|
def connection
|
23
23
|
@connection ||= Connection.new
|
@@ -7,17 +7,17 @@ module KSequencing
|
|
7
7
|
connection.get('/api/images/photo_tags', options)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def create(options = {})
|
11
11
|
options[:token] ||= KSequencing.project_key
|
12
|
-
connection.
|
12
|
+
connection.post('/api/images/photo_tags', options)
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def find_by(options = {})
|
16
16
|
options[:token] ||= KSequencing.project_key
|
17
|
-
connection.
|
17
|
+
connection.get('/api/images/photo_tag', options)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
private
|
21
21
|
|
22
22
|
def connection
|
23
23
|
@connection ||= Connection.new
|
@@ -2,14 +2,14 @@ module KSequencing
|
|
2
2
|
# :nodoc:
|
3
3
|
class Prediction
|
4
4
|
|
5
|
-
def
|
5
|
+
def all(options = {})
|
6
6
|
options[:token] ||= KSequencing.project_key
|
7
|
-
connection.
|
7
|
+
connection.get('/api/prime/predictions', options)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def create(options = {})
|
11
11
|
options[:token] ||= KSequencing.project_key
|
12
|
-
connection.
|
12
|
+
connection.post('/api/prime/predictions', options)
|
13
13
|
end
|
14
14
|
|
15
15
|
def find_by(options = {})
|
@@ -17,7 +17,7 @@ module KSequencing
|
|
17
17
|
connection.get("/api/prime/predictions/#{options[:id]}", options)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
private
|
21
21
|
|
22
22
|
def connection
|
23
23
|
@connection ||= Connection.new
|
data/lib/k_sequencing/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_sequencing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesdakorn Samittiauttakorn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.6.
|
128
|
+
rubygems_version: 2.6.8
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: KSequencing is a moderator service for your online content
|