a_parser_client 0.1.4 → 0.1.5
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 -1
- data/README.md +17 -9
- data/lib/a_parser_client.rb +81 -0
- data/lib/a_parser_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42e60203410c99b0db06edc1788deee8e1c4ced464b10ef096e9e03de1676d5
|
4
|
+
data.tar.gz: 0d59de0239b5a7e25adb62591f00d39e235cf845954377e1eeab01ae7f645abe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e0a2dc347538a632f42dbd6bc02567636f31295aebfd17944bcd3473138fd80085d4a5bc74cbd506f810c99aadec220ea88ed1740e3ee87a7d93309eddf911
|
7
|
+
data.tar.gz: 3620212938726b6594e8dd8a952b866b506ab01ac6e1a1bcfd348ffd9a9e73155bbc6a7cb4467b2f0bb688983ee25a207630f00829c33910b2f362920f3c29d7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# AParserClient
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/a_parser_client)
|
4
|
+
|
3
5
|
Ruby client for A-Parser user API.
|
4
6
|
|
5
7
|
This is a test release, more API coverage is upcoming.
|
@@ -13,19 +15,21 @@ Covered for now:
|
|
13
15
|
- getTaskConf
|
14
16
|
- addTask
|
15
17
|
- changeTaskStatus
|
18
|
+
- getAccountsCount
|
19
|
+
- getProxies
|
20
|
+
- update
|
21
|
+
- getTaskResultsFile
|
22
|
+
- deleteTaskResultsFile
|
23
|
+
- moveTask
|
24
|
+
- getParserInfo
|
25
|
+
- getParserPreset
|
16
26
|
|
17
27
|
TODO:
|
18
28
|
|
19
29
|
- oneRequest
|
20
30
|
- bulkRequest
|
21
|
-
|
22
|
-
|
23
|
-
- getTaskResultsFile
|
24
|
-
- deleteTaskResultsFile
|
25
|
-
- moveTask
|
26
|
-
- getParserInfo
|
27
|
-
- update
|
28
|
-
- getAccountsCount
|
31
|
+
|
32
|
+
|
29
33
|
|
30
34
|
## Installation
|
31
35
|
|
@@ -45,6 +49,10 @@ Or install it yourself as:
|
|
45
49
|
|
46
50
|
## Usage
|
47
51
|
|
52
|
+
There will be a wiki page soon.
|
53
|
+
|
54
|
+
The code sample below is all for now...
|
55
|
+
|
48
56
|
```ruby
|
49
57
|
require 'a_parser_client'
|
50
58
|
|
@@ -70,4 +78,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
70
78
|
|
71
79
|
## Code of Conduct
|
72
80
|
|
73
|
-
Everyone interacting in the AParserClient project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yvshevchenko
|
81
|
+
Everyone interacting in the AParserClient project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yvshevchenko/a_parser_client/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/a_parser_client.rb
CHANGED
@@ -98,6 +98,87 @@ module AParserClient
|
|
98
98
|
do_it request
|
99
99
|
end
|
100
100
|
|
101
|
+
def get_accounts_count
|
102
|
+
request = {
|
103
|
+
password: @api_password,
|
104
|
+
action: 'getAccountsCount',
|
105
|
+
data: {}
|
106
|
+
}
|
107
|
+
do_it request
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
def get_proxies
|
112
|
+
request = {
|
113
|
+
password: @api_password,
|
114
|
+
action: 'getProxies'
|
115
|
+
}
|
116
|
+
do_it request
|
117
|
+
end
|
118
|
+
|
119
|
+
def update!
|
120
|
+
request = {
|
121
|
+
password: @api_password,
|
122
|
+
action: 'update',
|
123
|
+
data: {}
|
124
|
+
}
|
125
|
+
do_it request
|
126
|
+
end
|
127
|
+
|
128
|
+
def get_task_results_file(task_id)
|
129
|
+
request = {
|
130
|
+
password: @api_password,
|
131
|
+
action: 'getTaskResultsFile',
|
132
|
+
data: {taskUid: task_id}
|
133
|
+
}
|
134
|
+
do_it request
|
135
|
+
end
|
136
|
+
|
137
|
+
def delete_task_results_file(task_id)
|
138
|
+
request = {
|
139
|
+
password: @api_password,
|
140
|
+
action: 'deleteTaskResultsFile',
|
141
|
+
data: {taskUid: task_id}
|
142
|
+
}
|
143
|
+
do_it request
|
144
|
+
end
|
145
|
+
|
146
|
+
def move_task(task_id, direction)
|
147
|
+
request = {
|
148
|
+
password: @api_password,
|
149
|
+
action: 'moveTask',
|
150
|
+
data: {
|
151
|
+
taskUid: task_id,
|
152
|
+
toStatus: direction
|
153
|
+
}
|
154
|
+
}
|
155
|
+
do_it request
|
156
|
+
end
|
157
|
+
|
158
|
+
def get_parser_info(parser_name)
|
159
|
+
request = {
|
160
|
+
password: @api_password,
|
161
|
+
action: 'getParserInfo',
|
162
|
+
data: {
|
163
|
+
parser: parser_name
|
164
|
+
}
|
165
|
+
}
|
166
|
+
do_it request
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
def get_parser_preset(parser_name, preset_name)
|
171
|
+
request = {
|
172
|
+
password: @api_password,
|
173
|
+
action: 'getParserInfo',
|
174
|
+
data: {
|
175
|
+
parser: parser_name,
|
176
|
+
reset: preset_name
|
177
|
+
}
|
178
|
+
}
|
179
|
+
do_it request
|
180
|
+
end
|
181
|
+
|
101
182
|
|
102
183
|
private # internal use only
|
103
184
|
|