mrweb 1.7.1
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 +7 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/bin/hello-world +1 -0
- data/lib/exceptions.rb +26 -0
- data/lib/mrweb/version.rb +5 -0
- data/lib/mrweb.rb +340 -0
- data/mrweb.gemspec +45 -0
- metadata +52 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 48615a93dc30f035c6e8351c1655dfd65930fdeabe4e8840f655cff86a60482b
|
|
4
|
+
data.tar.gz: 868dc07fb4b95f04635951ef899271611b3a06f1519d5c9f28a97ec55af04da8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 0006e8ebb9609a356b24cfe8242d89856b8ba091fc549d5431c55032e668bb73c7c6836851510ac9645155359ad12a274b0224a4b4a6f5476880bbd66d02760b
|
|
7
|
+
data.tar.gz: 34a24209eeda9573619706dc79ba0a48bfd53f9710306a20a2420551a82c757b1c5f1e5f054fdb4ce097679f4c9b53839515724b3d3db7acfd40272279081536
|
data/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2009 kunto aji
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
= hello-world
|
|
2
|
+
|
|
3
|
+
gem to print output "hello world!". useful for tutorial how to make a ruby gem.
|
|
4
|
+
|
|
5
|
+
== Note on Patches/Pull Requests
|
|
6
|
+
|
|
7
|
+
* Fork the project.
|
|
8
|
+
* Make your feature addition or bug fix.
|
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
|
10
|
+
future version unintentionally.
|
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
|
14
|
+
|
|
15
|
+
== Copyright
|
|
16
|
+
|
|
17
|
+
Copyright (c) 2010 kunto aji. See LICENSE for details.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
|
|
4
|
+
begin
|
|
5
|
+
require 'jeweler'
|
|
6
|
+
Jeweler::Tasks.new do |gem|
|
|
7
|
+
gem.name = "hello-world"
|
|
8
|
+
gem.summary = "one-line summary of your gem"
|
|
9
|
+
gem.description = "longer description of your gem"
|
|
10
|
+
gem.email = "aji_okay@yahoo.co.id"
|
|
11
|
+
gem.homepage = "http://github.com/kuntoaji/hello-world"
|
|
12
|
+
gem.authors = ["kunto aji"]
|
|
13
|
+
gem.executables = ["hello-world"]
|
|
14
|
+
end
|
|
15
|
+
Jeweler::GemcutterTasks.new
|
|
16
|
+
rescue LoadError
|
|
17
|
+
puts "hello-world is not available. Install it with: gem install hello-world"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
require 'rake/testtask'
|
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
|
22
|
+
test.libs << 'lib' << 'test'
|
|
23
|
+
test.pattern = 'test/**/test_*.rb'
|
|
24
|
+
test.verbose = true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
begin
|
|
28
|
+
require 'rcov/rcovtask'
|
|
29
|
+
Rcov::RcovTask.new do |test|
|
|
30
|
+
test.libs << 'test'
|
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
|
32
|
+
test.verbose = true
|
|
33
|
+
end
|
|
34
|
+
rescue LoadError
|
|
35
|
+
task :rcov do
|
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
task :test => :check_dependencies
|
|
41
|
+
|
|
42
|
+
task :default => :test
|
|
43
|
+
|
|
44
|
+
require 'rake/rdoctask'
|
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
47
|
+
|
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
49
|
+
rdoc.title = "hello-world #{version}"
|
|
50
|
+
rdoc.rdoc_files.include('README*')
|
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
52
|
+
end
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.0
|
data/bin/hello-world
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
puts "this is executable hello-world"
|
data/lib/exceptions.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class AIError < StandardError
|
|
2
|
+
end
|
|
3
|
+
|
|
4
|
+
class APIError < StandardError
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class NoInternet < StandardError
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class JsonError < StandardError
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class NoCoin < StandardError
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class EndSupport < StandardError
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class WrongAPIKEY < StandardError
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class EnvError < StandardError
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class DownloadError < StandardError
|
|
26
|
+
end
|
data/lib/mrweb.rb
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "mrweb/version"
|
|
4
|
+
require 'net/http'
|
|
5
|
+
require 'json'
|
|
6
|
+
require 'uri'
|
|
7
|
+
require 'cgi'
|
|
8
|
+
require_relative 'exceptions'
|
|
9
|
+
module Mrweb
|
|
10
|
+
class Error < StandardError; end
|
|
11
|
+
class API
|
|
12
|
+
def initialize(apikey = nil, use_testkey = false, env = false)
|
|
13
|
+
@apikey = apikey
|
|
14
|
+
if use_testkey
|
|
15
|
+
@apikey = 'testkey'
|
|
16
|
+
elsif env
|
|
17
|
+
begin
|
|
18
|
+
@apikey = ENV['MRWEB_APIKEY']
|
|
19
|
+
rescue
|
|
20
|
+
raise EnvError, 'Failed To Get APIKEY From env please Set By Name MRWEB_APIKEY in environ variable name'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def translate(to, text)
|
|
26
|
+
parms = { 'to' => to, 'text' => text }
|
|
27
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/translate.php?#{URI.encode_www_form(parms)}"))
|
|
28
|
+
result = JSON.parse(api)
|
|
29
|
+
begin
|
|
30
|
+
return result['translate']
|
|
31
|
+
rescue KeyError
|
|
32
|
+
raise APIError, "Translate Error For Lang #{to}"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def ocr(to, url)
|
|
37
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/ocr.php?url=#{url}&lang=#{to}"))
|
|
38
|
+
result = JSON.parse(api)
|
|
39
|
+
begin
|
|
40
|
+
return result['result']
|
|
41
|
+
rescue KeyError
|
|
42
|
+
raise APIError, "Error In OCR Lang #{to}"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def isbadword(text)
|
|
47
|
+
text = CGI.escape("text=#{text}")
|
|
48
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/badword.php?#{text}"))
|
|
49
|
+
result = JSON.parse(api)
|
|
50
|
+
return result['isbadword'] == true
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def randbio
|
|
54
|
+
return Net::HTTP.get(URI('https://mrapiweb.ir/api/bio.php'))
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def isaitext(text)
|
|
58
|
+
text = CGI.escape("text=#{text}")
|
|
59
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/aitext.php?#{text}"))
|
|
60
|
+
result = JSON.parse(api)
|
|
61
|
+
return result['aipercent'] != '0%'
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def notebook(text, savetofile = false, filename = nil)
|
|
65
|
+
text = text.gsub(' ', '-')
|
|
66
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/notebook.php?text=#{text}"))
|
|
67
|
+
if savetofile
|
|
68
|
+
if filename.nil?
|
|
69
|
+
raise Exception, 'Filename Is Required!'
|
|
70
|
+
end
|
|
71
|
+
File.open(filename, 'wb') do |mr|
|
|
72
|
+
mr.write(api)
|
|
73
|
+
end
|
|
74
|
+
else
|
|
75
|
+
return api
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def email(to, subject, text)
|
|
80
|
+
send = "to=#{to}&subject=#{subject}&message=#{text}"
|
|
81
|
+
Net::HTTP.get(URI("https://mrapiweb.ir/api/email.php?#{send}"))
|
|
82
|
+
return "Email Sent To #{to}"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def ipinfo(ip)
|
|
86
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/ipinfo.php?ipaddr=#{ip}"))
|
|
87
|
+
ip = JSON.parse(api)
|
|
88
|
+
begin
|
|
89
|
+
return ip
|
|
90
|
+
rescue
|
|
91
|
+
raise APIError, "Failed To Get This IP Information : #{ip}"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def insta(link)
|
|
96
|
+
return link.gsub('instagram.com', 'ddinstagram.com')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def voicemaker(text, sayas = 'man', filename = nil)
|
|
100
|
+
text = text.gsub(' ', '-')
|
|
101
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/voice.php?sayas=#{sayas}&text=#{text}"))
|
|
102
|
+
if filename.nil?
|
|
103
|
+
raise Exception, 'Filename Is Required!'
|
|
104
|
+
end
|
|
105
|
+
File.open(filename, 'wb') do |mr|
|
|
106
|
+
mr.write(api)
|
|
107
|
+
end
|
|
108
|
+
return true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def imagegen(text)
|
|
112
|
+
apikey = @apikey
|
|
113
|
+
text = text.gsub(' ', '-')
|
|
114
|
+
return Net::HTTP.get(URI("https://mrapiweb.ir/api/imagegen.php?key=#{apikey}&imgtext=#{text}"))
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def proxy
|
|
118
|
+
api = Net::HTTP.get(URI('https://mrapiweb.ir/api/telproxy.php'))
|
|
119
|
+
proxy = JSON.parse(api)
|
|
120
|
+
return proxy['connect']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def fal(filename)
|
|
124
|
+
api = Net::HTTP.get(URI('https://mrapiweb.ir/api/fal.php'))
|
|
125
|
+
File.open(filename, 'wb') do |mr|
|
|
126
|
+
mr.write(api)
|
|
127
|
+
end
|
|
128
|
+
return true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def worldclock
|
|
132
|
+
return Net::HTTP.get(URI('https://mrapiweb.ir/api/zone.php'))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def youtube(vid)
|
|
136
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/yt.php?key=#{@apikey}&id=#{vid}"))
|
|
137
|
+
return api
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def sendweb3(privatekey = nil, address = nil, amount = nil, rpc = nil, chainid = nil)
|
|
141
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/wallet.php?key=#{privatekey}&address=#{address}&amount=#{amount}&rpc=#{rpc}&chainid=#{chainid}"))
|
|
142
|
+
return api
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def google_drive(link)
|
|
146
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/gdrive.php?url=#{link}"))
|
|
147
|
+
drive = JSON.parse(api)
|
|
148
|
+
return drive['link']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def bing_dalle(text)
|
|
152
|
+
raise EndSupport, 'Bing Dalle Is End Of Support'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def wikipedia(text)
|
|
156
|
+
return Net::HTTP.get(URI("https://mrapiweb.ir/wikipedia/?find=#{text}&lang=fa"))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def chrome_extention(id, file)
|
|
160
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/chrome.php?id=#{id}"))
|
|
161
|
+
File.open(file, 'wb') do |f|
|
|
162
|
+
f.write(api)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def fakesite(site)
|
|
167
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/fakesite.php?site=#{site}"))
|
|
168
|
+
return JSON.parse(api)['is_real']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def webshot(site, filesave)
|
|
172
|
+
apikey = @apikey
|
|
173
|
+
api1 = Net::HTTP.get(URI("https://mrapiweb.ir/api/webshot.php?key=#{apikey}&url=#{site}&fullSize=false&height=512&width=512"))
|
|
174
|
+
begin
|
|
175
|
+
File.open(filesave, 'wb') do |f|
|
|
176
|
+
f.write(api1)
|
|
177
|
+
end
|
|
178
|
+
rescue
|
|
179
|
+
return api1
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def barcode(code)
|
|
184
|
+
apikey = @apikey
|
|
185
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/barcode.php?key=#{apikey}&code=#{code}"))
|
|
186
|
+
begin
|
|
187
|
+
return JSON.parse(api)['result']
|
|
188
|
+
rescue
|
|
189
|
+
return JSON.parse(api)['message']
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def domain_check(domain)
|
|
194
|
+
api = JSON.parse(Net::HTTP.get(URI("https://mrapiweb.ir/api/domain.php?domain=#{domain}")))
|
|
195
|
+
return api
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def qr(texturl, action = 'encode', savefile = true)
|
|
199
|
+
if action == 'encode'
|
|
200
|
+
text = "action=#{action}&text=#{texturl}"
|
|
201
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/qr/qrcode.php?#{text}"))
|
|
202
|
+
if savefile
|
|
203
|
+
File.open('qr.png', 'wb') do |f|
|
|
204
|
+
f.write(api)
|
|
205
|
+
end
|
|
206
|
+
else
|
|
207
|
+
return api
|
|
208
|
+
end
|
|
209
|
+
else
|
|
210
|
+
text = "action=#{action}&url=#{texturl}"
|
|
211
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/qr/qrcode.php?#{text}"))
|
|
212
|
+
return api
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
class AI
|
|
217
|
+
def initialize
|
|
218
|
+
@version = "1.7"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def bard(query)
|
|
222
|
+
begin
|
|
223
|
+
result = Net::HTTP.get(URI.parse("https://mrapiweb.ir/bardai/ask?text=#{URI.encode_www_form_component(query)}"))
|
|
224
|
+
return result
|
|
225
|
+
rescue Exception => er
|
|
226
|
+
raise AIError.new("Failed To Get Response From Bard", er)
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def gpt(query)
|
|
231
|
+
query = URI.encode_www_form_component(query)
|
|
232
|
+
begin
|
|
233
|
+
return Net::HTTP.get(URI.parse("https://mrapiweb.ir/ai/?#{query}"))
|
|
234
|
+
rescue Exception => er
|
|
235
|
+
raise AIError.new("Failed To Get Answer. Make Sure That You Are Connected To Internet & VPN is off", nil)
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def evilgpt(query)
|
|
240
|
+
raise EndSupport.new("EvilGPT Is End Of Support", nil)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
def gemini(query)
|
|
244
|
+
query = URI.encode_www_form_component(query)
|
|
245
|
+
api = Net::HTTP.get(URI.parse("https://mrapiweb.ir/api/geminiai.php?#{query}"))
|
|
246
|
+
begin
|
|
247
|
+
return api
|
|
248
|
+
rescue
|
|
249
|
+
raise AIError.new("No Answer Found From Gemini. Please Try Again!", nil)
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
def codeai(query)
|
|
254
|
+
query = URI.encode_www_form_component(query)
|
|
255
|
+
api = Net::HTTP.get(URI.parse("https://mrapiweb.ir/api/aiblack.php?#{query}"))
|
|
256
|
+
begin
|
|
257
|
+
return api
|
|
258
|
+
rescue
|
|
259
|
+
raise AIError.new("No Answer Found From CodeAI. Please Try Again!", nil)
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
def gemma(query)
|
|
264
|
+
query = URI.encode_www_form_component(query)
|
|
265
|
+
api = Net::HTTP.get(URI.parse("https://mrapiweb.ir/chatbot/newrouter.php?#{query}"))
|
|
266
|
+
begin
|
|
267
|
+
return api
|
|
268
|
+
rescue
|
|
269
|
+
raise AIError.new("No Answer Found From Gemma. Please Try Again!", nil)
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def zzzcode(prompt, language = "python", mode = "normal")
|
|
274
|
+
begin
|
|
275
|
+
query = URI.encode_www_form({ "question" => prompt, "lang" => language, "mode" => mode })
|
|
276
|
+
return Net::HTTP.get(URI.parse("https://mrapiweb.ir/chatbot/zzzcode.php?#{query}"))
|
|
277
|
+
rescue
|
|
278
|
+
raise AIError.new("No Answer Found From Zzzcode. Please Try Again!", nil)
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
class FAKEMAIL
|
|
283
|
+
def initialize
|
|
284
|
+
@version = "1.7"
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
def create
|
|
288
|
+
response = Net::HTTP.get(URI("https://mrapiweb.ir/api/fakemail.php?method=getNewMail"))
|
|
289
|
+
JSON.parse(response)["results"]["email"]
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
def getmails(email)
|
|
293
|
+
response = Net::HTTP.get(URI("https://mrapiweb.ir/api/fakemail.php?method=getMessages&email=#{email}"))
|
|
294
|
+
JSON.parse(response)["results"]
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
class HashCheck
|
|
298
|
+
def initialize
|
|
299
|
+
@version = "1.7"
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
def tron(thash)
|
|
303
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/cryptocheck/tron.php?hash=#{thash}"))
|
|
304
|
+
tron = JSON.parse(api)
|
|
305
|
+
return tron
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
def tomochain(thash)
|
|
309
|
+
api = Net::HTTP.get(URI("https://mrapiweb.ir/api/cryptocheck/tomochain.php?hash=#{thash}"))
|
|
310
|
+
tomo = JSON.parse(api)
|
|
311
|
+
return tomo
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
class TRON
|
|
315
|
+
def initialize
|
|
316
|
+
@version = "1.7"
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def generate
|
|
320
|
+
api = JSON.parse(Net::HTTP.get(URI("https://mrapiweb.ir/api/tronapi.php?action=genaddress")))
|
|
321
|
+
return api
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def balance(address)
|
|
325
|
+
api = JSON.parse(Net::HTTP.get(URI("https://mrapiweb.ir/api/tronapi.php?action=getbalance&address=#{address}")))
|
|
326
|
+
return api["balance"]
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
def info(address)
|
|
330
|
+
api = JSON.parse(Net::HTTP.get(URI("https://mrapiweb.ir/api/tronapi.php?action=addressinfo&address=#{address}")))
|
|
331
|
+
return api
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
def send(key, fromadd, to, amount)
|
|
335
|
+
api = JSON.parse(Net::HTTP.get(URI("https://mrapiweb.ir/api/tronapi.php?action=sendtrx&key=#{key}&fromaddress=#{fromadd}&toaddress=#{to}&amount=#{amount}")))
|
|
336
|
+
return api
|
|
337
|
+
end
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
end
|
data/mrweb.gemspec
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = %q{mrweb}
|
|
8
|
+
s.version = "1.7.1"
|
|
9
|
+
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
+
s.authors = ["moorgh"]
|
|
12
|
+
s.date = %q{2024-04-10}
|
|
13
|
+
s.default_executable = %q{hello-world}
|
|
14
|
+
s.description = %q{longer description of your gem}
|
|
15
|
+
s.email = %q{vboxvm512@gmail.com}
|
|
16
|
+
s.executables = ["hello-world"]
|
|
17
|
+
s.files = [
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.rdoc",
|
|
20
|
+
"Rakefile",
|
|
21
|
+
"VERSION",
|
|
22
|
+
"bin/hello-world",
|
|
23
|
+
"mrweb.gemspec",
|
|
24
|
+
"lib/mrweb.rb",
|
|
25
|
+
"lib/exceptions.rb",
|
|
26
|
+
"lib/mrweb/version.rb"
|
|
27
|
+
]
|
|
28
|
+
s.homepage = %q{https://mrapiweb.ir}
|
|
29
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
|
30
|
+
s.require_paths = ["lib"]
|
|
31
|
+
s.rubygems_version = %q{1.3.5}
|
|
32
|
+
s.summary = %q{Join @mrwebservice on telegram for api}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if s.respond_to? :specification_version then
|
|
36
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
37
|
+
s.specification_version = 3
|
|
38
|
+
|
|
39
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.7.1') then
|
|
40
|
+
else
|
|
41
|
+
end
|
|
42
|
+
else
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
metadata
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mrweb
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.7.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- moorgh
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2024-04-10 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: longer description of your gem
|
|
14
|
+
email: vboxvm512@gmail.com
|
|
15
|
+
executables:
|
|
16
|
+
- hello-world
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- LICENSE
|
|
21
|
+
- README.rdoc
|
|
22
|
+
- Rakefile
|
|
23
|
+
- VERSION
|
|
24
|
+
- bin/hello-world
|
|
25
|
+
- lib/exceptions.rb
|
|
26
|
+
- lib/mrweb.rb
|
|
27
|
+
- lib/mrweb/version.rb
|
|
28
|
+
- mrweb.gemspec
|
|
29
|
+
homepage: https://mrapiweb.ir
|
|
30
|
+
licenses: []
|
|
31
|
+
metadata: {}
|
|
32
|
+
post_install_message:
|
|
33
|
+
rdoc_options:
|
|
34
|
+
- "--charset=UTF-8"
|
|
35
|
+
require_paths:
|
|
36
|
+
- lib
|
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '0'
|
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubygems_version: 3.2.15
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 3
|
|
51
|
+
summary: Join @mrwebservice on telegram for api
|
|
52
|
+
test_files: []
|