pampa_workers 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mybotprocess.rb +30 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caea45d434da43ea67afef7bc6bb493f5a40b44b
|
4
|
+
data.tar.gz: 073300b12dae57a3b354ee2bd12ad094ea3661bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad4f1eec949e91fd694afbc36043bf45e6fea95634175adb3b171e128c1f92327fca5b1b2bf14cfcdf38d27bf5ef528c6d57189787ff70577570b4c654f23e2
|
7
|
+
data.tar.gz: a50659c82af48217c6a2c48b92f678aabdff92daa73fe472a60d4dbc869ac44761b0d1de8a5860daae7fb5a801e46125daec14de37d10ccc52bff34f69d1ba1e
|
data/lib/mybotprocess.rb
CHANGED
@@ -101,7 +101,37 @@ module BlackStack
|
|
101
101
|
|
102
102
|
return lnuser
|
103
103
|
end # getLnUser()
|
104
|
+
|
105
|
+
#
|
106
|
+
def notifyInbox(lnuser, conv)
|
107
|
+
conv[:chats].each { |chat|
|
108
|
+
# armo URL de notificacion
|
109
|
+
# se usa URI.encode para codificar caracteres no-ascii en los mensajes
|
110
|
+
url =
|
111
|
+
"#{BlackStack::Pampa::api_protocol}://#{self.ws_url}:#{self.ws_port}/api1.3/pampa/scrape.inbox/notify_lnchat.json?" +
|
112
|
+
"api_key=#{BlackStack::Pampa::api_key}&" +
|
113
|
+
"profile_code=#{URI.escape(conv[:profile_code])}&" +
|
114
|
+
"profile_name=#{URI.escape(conv[:profile_name])}&" +
|
115
|
+
"profile_headline=#{URI.escape(conv[:profile_headline])}&" +
|
116
|
+
"first=#{URI.escape(conv[:first])}&" +
|
117
|
+
"position=#{chat[:position].to_s}&" +
|
118
|
+
"uid=#{lnuser['id']}&" +
|
119
|
+
"sender_name=#{URI.escape(chat[:sender_name])}&" +
|
120
|
+
"body=#{URI.escape(chat[:body])}&"
|
121
|
+
|
122
|
+
# HELP: File.open('./output3.txt', 'a') { |file| file.write(url + "\r\n") }
|
104
123
|
|
124
|
+
# push the chat
|
125
|
+
uri = URI.parse(url.to_s)
|
126
|
+
req = Net::HTTP::Get.new(uri.to_s)
|
127
|
+
res = Net::HTTP.start(uri.host, uri.port, :use_ssl => true, :verify_mode => OpenSSL::SSL::VERIFY_NONE) {|http|
|
128
|
+
http.request(req)
|
129
|
+
}
|
130
|
+
parsed = JSON.parse(res.body)
|
131
|
+
raise "error uploading chat: #{parsed['status']}" if parsed['status'] != 'success'
|
132
|
+
} # conv[:chats].each
|
133
|
+
end
|
134
|
+
|
105
135
|
#
|
106
136
|
def notifyLnUserUrl(id_lnuser, profile_url)
|
107
137
|
nTries = 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pampa_workers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket
|