nextbot 1.1.1 → 1.1.9
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/lib/basecommand.rb +2 -2
- data/lib/localcommand.rb +7 -2
- data/lib/nextbot.rb +12 -0
- data/lib/remotecommand.rb +35 -34
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2892c81884d85bd6ddf5a155109f2ec35f600475
|
4
|
+
data.tar.gz: 3ea958f3c2c16775cea6d1c6d9bd191c83cf1013
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e31d6ac090792af78e6ded485aa8b72a7652e6d0d05c28770f32bf30ffe4795a54b0ed17cef7174114bf4428039de608fbfc8930cfb2b723b4fd5c08bb479f02
|
7
|
+
data.tar.gz: 582f1dc56e0675ba418d4e58cb7684a03a7192976de3fb3349449c370253f29244290fd603f021d1a899f71e9972644faa01f6c6c7ff427829b08ddb73b23633
|
data/lib/basecommand.rb
CHANGED
@@ -10,7 +10,7 @@ module BlackStack
|
|
10
10
|
# => The "remote" (or API class) that will
|
11
11
|
# => be receive the data from an API call.
|
12
12
|
#
|
13
|
-
|
13
|
+
module BaseCommand
|
14
14
|
TYPE_START = 100 # start browser. params: username
|
15
15
|
TYPE_LOGIN = 110 # login to account. param: social_media (LinkedIn, Facebook, Twitter)
|
16
16
|
TYPE_GOTO = 120 # param: url
|
@@ -55,6 +55,6 @@ module BlackStack
|
|
55
55
|
#return "each" if n == TYPE_EACH
|
56
56
|
return "close" if n == TYPE_CLOSE
|
57
57
|
end # self.typeDescription
|
58
|
-
end #
|
58
|
+
end # module BaseCommand
|
59
59
|
end # module NextBot
|
60
60
|
end # module BlackStack
|
data/lib/localcommand.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative './
|
1
|
+
require_relative './basecommand'
|
2
2
|
|
3
3
|
module BlackStack
|
4
4
|
module NextBot
|
@@ -45,9 +45,14 @@ module BlackStack
|
|
45
45
|
ret[:id] = self.id.to_guid
|
46
46
|
ret[:id_worker] = self.id_worker.to_guid
|
47
47
|
ret[:type] = self.type
|
48
|
-
|
48
|
+
# start command params
|
49
|
+
ret[:param_start_id_lnuser] = self.param_start_id_lnuser
|
50
|
+
ret[:param_start_username] = self.param_start_id_lnuser.nil? ? nil : LnUser.where(:id=>self.param_start_id_lnuser).first.username
|
51
|
+
# login command params
|
49
52
|
ret[:param_login_id_domain] = self.param_login_id_domain.nil? ? nil : self.param_login_id_domain.to_guid
|
53
|
+
# goto command params
|
50
54
|
ret[:param_goto_url] = self.param_goto_url
|
55
|
+
# command
|
51
56
|
return ret
|
52
57
|
end
|
53
58
|
|
data/lib/nextbot.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'stealth_browser_automation'
|
2
|
+
require_relative './basecommand'
|
3
|
+
require_relative './remotecommand'
|
4
|
+
|
5
|
+
module BlackStack
|
6
|
+
module NextBot
|
7
|
+
def self.require_db_classes()
|
8
|
+
# You have to load all the Sinatra classes after connect the database.
|
9
|
+
require_relative '../lib/localcommand.rb'
|
10
|
+
end
|
11
|
+
end # module NextBot
|
12
|
+
end # module BlackStack
|
data/lib/remotecommand.rb
CHANGED
@@ -5,8 +5,8 @@ module BlackStack
|
|
5
5
|
module NextBot
|
6
6
|
# The "remote" (or API class) that will
|
7
7
|
# be receive the data from an API call.
|
8
|
-
class RemoteCommand <
|
9
|
-
include BaseCommand
|
8
|
+
class RemoteCommand < BlackStack::NextBot::BaseRemoteObject
|
9
|
+
include BlackStack::NextBot::BaseCommand
|
10
10
|
|
11
11
|
# :browser: is the browser where the bot will operate.
|
12
12
|
attr_accessor :browser
|
@@ -14,21 +14,22 @@ module BlackStack
|
|
14
14
|
# :id is the ID of the record in the "routine" table.
|
15
15
|
# :params is an array of RemoteParam objects.
|
16
16
|
# :steps is an array of RemoteSteps objects.
|
17
|
-
attr_accessor :id, :id_worker, :type, :param_start_username, :param_login_id_domain, :param_goto_url
|
17
|
+
attr_accessor :id, :id_worker, :type, :param_start_id_lnuser, :param_start_username, :param_login_id_domain, :param_goto_url
|
18
18
|
|
19
19
|
# generate all the hierarchy of the bot (routines, steps,
|
20
20
|
# => params) from a hash descriptor.
|
21
21
|
def build(h)
|
22
22
|
super(h)
|
23
|
-
self.id = h[
|
24
|
-
self.id_worker = h[
|
25
|
-
self.type = h[
|
23
|
+
self.id = h['id']
|
24
|
+
self.id_worker = h['id_worker']
|
25
|
+
self.type = h['type']
|
26
26
|
# start command params
|
27
|
-
self.
|
27
|
+
self.param_start_id_lnuser = h['param_start_id_lnuser']
|
28
|
+
self.param_start_username = h['param_start_username']
|
28
29
|
# login command params
|
29
|
-
self.param_login_id_domain = h[
|
30
|
+
self.param_login_id_domain = h['param_login_id_domain']
|
30
31
|
# goto command params
|
31
|
-
self.param_goto_url = h[
|
32
|
+
self.param_goto_url = h['param_goto_url']
|
32
33
|
# TODO: map here all the other attributes of the record in the "command" table,
|
33
34
|
# regarding every one of the possible "type" of steps.
|
34
35
|
end
|
@@ -58,15 +59,15 @@ module BlackStack
|
|
58
59
|
|
59
60
|
# run the specified operation for this "type" of "step"
|
60
61
|
def run()
|
61
|
-
raise 'This is an abstract method. Each child of the
|
62
|
+
raise 'This is an abstract method. Each child of the RemoteCommand class will code its own "run" method.'
|
62
63
|
end
|
63
|
-
end # class
|
64
|
+
end # class RemoteCommand
|
64
65
|
|
65
66
|
|
66
67
|
##################################################################################
|
67
68
|
### RemoteStepStart
|
68
69
|
##################################################################################
|
69
|
-
class
|
70
|
+
class RemoteCommandStart < RemoteCommand
|
70
71
|
# run the specified operation for this "type" of "step"
|
71
72
|
def run()
|
72
73
|
# TODO: Code Me!
|
@@ -78,123 +79,123 @@ module BlackStack
|
|
78
79
|
### RemoteStepLogin
|
79
80
|
### TODO: deprecate this, and replace for a procedure, once the project is full done.
|
80
81
|
##################################################################################
|
81
|
-
class
|
82
|
+
class RemoteCommandLogin < RemoteCommand
|
82
83
|
# run the specified operation for this "type" of "step"
|
83
84
|
def run()
|
84
85
|
# TODO: Code Me!
|
85
86
|
end
|
86
|
-
end #
|
87
|
+
end # RemoteCommandLogin
|
87
88
|
|
88
89
|
|
89
90
|
##################################################################################
|
90
91
|
### RemoteStepGoto
|
91
92
|
##################################################################################
|
92
|
-
class
|
93
|
+
class RemoteCommandGoto < RemoteCommand
|
93
94
|
# run the specified operation for this "type" of "step"
|
94
95
|
def run()
|
95
96
|
# TODO: Code Me!
|
96
97
|
end
|
97
|
-
end #
|
98
|
+
end # RemoteCommandGoto
|
98
99
|
|
99
100
|
# TODO: develop these steps
|
100
101
|
=begin
|
101
102
|
##################################################################################
|
102
103
|
### RemoteStepFind
|
103
104
|
##################################################################################
|
104
|
-
class
|
105
|
+
class RemoteCommandFind < RemoteCommand
|
105
106
|
# run the specified operation for this "type" of "step"
|
106
107
|
def run()
|
107
108
|
# TODO: Code Me!
|
108
109
|
end
|
109
|
-
end #
|
110
|
+
end # RemoteCommandFind
|
110
111
|
|
111
112
|
|
112
113
|
##################################################################################
|
113
114
|
### RemoteStepMouse
|
114
115
|
##################################################################################
|
115
|
-
class
|
116
|
+
class RemoteCommandMouse < RemoteCommand
|
116
117
|
# run the specified operation for this "type" of "step"
|
117
118
|
def run()
|
118
119
|
# TODO: Code Me!
|
119
120
|
end
|
120
|
-
end #
|
121
|
+
end # RemoteCommandMouse
|
121
122
|
|
122
123
|
|
123
124
|
##################################################################################
|
124
125
|
### RemoteStepWrite
|
125
126
|
##################################################################################
|
126
|
-
class
|
127
|
+
class RemoteCommandWrite < RemoteCommand
|
127
128
|
# run the specified operation for this "type" of "step"
|
128
129
|
def run()
|
129
130
|
# TODO: Code Me!
|
130
131
|
end
|
131
|
-
end #
|
132
|
+
end # RemoteCommandWrite
|
132
133
|
|
133
134
|
|
134
135
|
##################################################################################
|
135
136
|
### RemoteStepDelay
|
136
137
|
##################################################################################
|
137
|
-
class
|
138
|
+
class RemoteCommandDelay < RemoteCommand
|
138
139
|
# run the specified operation for this "type" of "step"
|
139
140
|
def run()
|
140
141
|
# TODO: Code Me!
|
141
142
|
end
|
142
|
-
end #
|
143
|
+
end # RemoteCommandDelay
|
143
144
|
|
144
145
|
|
145
146
|
##################################################################################
|
146
147
|
### RemoteStepCall
|
147
148
|
##################################################################################
|
148
|
-
class
|
149
|
+
class RemoteCommandCall < RemoteCommand
|
149
150
|
# run the specified operation for this "type" of "step"
|
150
151
|
def run()
|
151
152
|
# TODO: Code Me!
|
152
153
|
end
|
153
|
-
end #
|
154
|
+
end # RemoteCommandCall
|
154
155
|
|
155
156
|
|
156
157
|
##################################################################################
|
157
158
|
### RemoteStepIf
|
158
159
|
##################################################################################
|
159
|
-
class
|
160
|
+
class RemoteCommandIf < RemoteCommand
|
160
161
|
# run the specified operation for this "type" of "step"
|
161
162
|
def run()
|
162
163
|
# TODO: Code Me!
|
163
164
|
end
|
164
|
-
end #
|
165
|
+
end # RemoteCommandIf
|
165
166
|
|
166
167
|
|
167
168
|
##################################################################################
|
168
169
|
### RemoteStepExists
|
169
170
|
##################################################################################
|
170
|
-
class
|
171
|
+
class RemoteCommandExists < RemoteCommand
|
171
172
|
# run the specified operation for this "type" of "step"
|
172
173
|
def run()
|
173
174
|
# TODO: Code Me!
|
174
175
|
end
|
175
|
-
end #
|
176
|
+
end # RemoteCommandExists
|
176
177
|
|
177
178
|
|
178
179
|
##################################################################################
|
179
180
|
### RemoteStepEach
|
180
181
|
##################################################################################
|
181
|
-
class
|
182
|
+
class RemoteCommandEach < RemoteCommand
|
182
183
|
# run the specified operation for this "type" of "step"
|
183
184
|
def run()
|
184
185
|
# TODO: Code Me!
|
185
186
|
end
|
186
|
-
end #
|
187
|
+
end # RemoteCommandEach
|
187
188
|
=end
|
188
189
|
|
189
190
|
##################################################################################
|
190
191
|
### RemoteStepClose
|
191
192
|
##################################################################################
|
192
|
-
class
|
193
|
+
class RemoteCommandClose < RemoteCommand
|
193
194
|
# run the specified operation for this "type" of "step"
|
194
195
|
def run()
|
195
196
|
# TODO: Code Me!
|
196
197
|
end
|
197
|
-
end #
|
198
|
+
end # RemoteCommandClose
|
198
199
|
|
199
200
|
end # module NextBot
|
200
201
|
end # module BlackStack
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nextbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
@@ -38,6 +38,7 @@ extra_rdoc_files: []
|
|
38
38
|
files:
|
39
39
|
- lib/basecommand.rb
|
40
40
|
- lib/localcommand.rb
|
41
|
+
- lib/nextbot.rb
|
41
42
|
- lib/remotebaseobject.rb
|
42
43
|
- lib/remotecommand.rb
|
43
44
|
homepage: https://rubygems.org/gems/simple_cloud_logging
|