tempsms22 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1faa829158e2c23fc576967dbe414a9aec307f387185dfe9bd78ec0abddea43c
4
- data.tar.gz: b3dbbe605b322ef388addc03ddc87e7808743c17655a7b8a1bad6db43423c1ca
3
+ metadata.gz: 647d05cdd95f0ac88fe65ffadc591497aee3535bf6e228da7c314062a84544f1
4
+ data.tar.gz: ecb2a92740135501297a95325fde460f1502941771affef1d638a13adf63fb93
5
5
  SHA512:
6
- metadata.gz: 8c50027ab5e1a7993d1db279bf98a20c57c8491654c99705edf92bb738e2da12a99a335957061ad0ccf2f46bdedd6fbb9474511f3a72157ee1ae03e146f739a9
7
- data.tar.gz: 36d71ff2ecceb4e3a7cf170fce417079b8bd9556df460fc2fd9a2413c783977766623fbe8278a9a81c3f66806992332011456f19bedc0f70bbd2f20c43b6c010
6
+ metadata.gz: fdf3c83e596493eafa279a87bde12956964b806dcc340694c7269597942b8f2cac1957777b1288e03690879bdfd1c235518c4f76ab7756b5fa817f204dac0c57
7
+ data.tar.gz: a665f80edb1f85ccd7c85a80c6d692fa177920dace5c8131988efeffe950b6332a154c34903111951ec9cb74f72725fad2f24081e090b101a25657fca8c00b0a
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/tempsms22.rb CHANGED
@@ -10,38 +10,40 @@ require 'ostruct'
10
10
 
11
11
  class TempSMS22
12
12
 
13
- attr_reader :number
13
+ attr_accessor :number
14
14
 
15
15
  def initialize()
16
- @url = 'https://receive-smss.com/'
17
- get_smsnum()
18
- end
19
16
 
20
- def read()
17
+ @url = 'https://receive-smss.com/'
21
18
 
22
- url = @url + 'sms/' + @number + '/'
23
- doc = Nokorexi.new(url).to_doc
24
- table = doc.root.element('//table')
19
+ doc = Nokorexi.new(@url).to_doc
25
20
 
26
- a = table.xpath('tbody/tr').map do |x|
27
- x.xpath('td').map {|y| y.plaintext.strip }
21
+ @a = doc.root.xpath('//a[@class="number-boxes1-item-button"]').map do |x|
22
+ x.attributes[:href][/\d+/]
28
23
  end
29
24
 
30
- a.map {|x| OpenStruct.new(%i(from text date).zip(x).to_h) }
25
+ end
31
26
 
27
+ def number()
28
+ @number = @a.sample
32
29
  end
33
30
 
34
- private
31
+ def numbers()
32
+ @a
33
+ end
35
34
 
36
- def get_smsnum()
35
+ def read(number=@number)
37
36
 
38
- doc = Nokorexi.new(@url).to_doc
37
+ url = @url + 'sms/' + number + '/'
38
+ doc = Nokorexi.new(url).to_doc
39
+ table = doc.root.element('//table')
39
40
 
40
- a = doc.root.xpath('//a[@class="number-boxes1-item-button"]').map do |x|
41
- x.attributes[:href]
41
+ a = table.xpath('tbody/tr').map do |x|
42
+ x.xpath('td').map {|y| y.plaintext.strip }
42
43
  end
43
44
 
44
- @number = a.first[/\d+/]
45
+ a.map {|x| OpenStruct.new(%i(from text date).zip(x).to_h) }
46
+
45
47
  end
46
48
 
47
49
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tempsms22
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ztXMxbpG+JjUz/fW9/Hgk0gp01NgNz0mgAvQ/T1kKnXzjCX/emLM/BELrgG+A50g
36
36
  DiofcFRVJjgBmAXWh6f6wfj9
37
37
  -----END CERTIFICATE-----
38
- date: 2022-05-27 00:00:00.000000000 Z
38
+ date: 2022-05-29 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: nokorexi
metadata.gz.sig CHANGED
Binary file