tempsms22 0.1.0 → 0.1.3

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: 10a9863d8b0de9dafe30552dcf76150f734a7bd213086c2c0fd790e0c431468e
4
- data.tar.gz: c48457528bab5b22273f1995a3ac3e77d686bbf20320f6048856226ce4da9f85
3
+ metadata.gz: f2f1fd393f37114c069d82fb8c9932623c38419c657998fc54f6214137578357
4
+ data.tar.gz: 7e9cfd4ea9f7ecb7989ca4b32da8379ac51013e6191234ff4977629278203305
5
5
  SHA512:
6
- metadata.gz: fcb06c6470c236e06a682d777fd62be70434672994e4b3159b9111724fabcd82d92c9cc023b55fff2be9f96878e6915c4fe1a7fbe2e12807b4710406a39a1f26
7
- data.tar.gz: 36608139430252834005dbdb6946ce588167853f0d0eb970cec647e6952b3ab5f81ca5e59d040a72872d10c3c3cb377f83b8af0bb03572d48a2bb8280fb78bbe
6
+ metadata.gz: cd4584335f7320be63bedf137cdb3bcf550c83652f67ebbae95e8971dc5cff475aa878f70bb2b3b68cfbc11a91a0b18a208121f77b26c08aded7ef1460e2f146
7
+ data.tar.gz: d65aa6e3644d61cb30ba82c3f5b17024c4c9b1bd76de9a3d2c9632d57f7a37192ca5cefa2ead0a8dfcd2bf8e4a70af9dab58a9e81a8c46d6a60e65b50625d166
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/tempsms22.rb CHANGED
@@ -5,42 +5,46 @@
5
5
  # description: Scrapes the temporary SMS number from receive-smss.com.
6
6
 
7
7
  require 'nokorexi'
8
+ require 'ostruct'
8
9
 
9
10
 
10
11
  class TempSMS22
11
12
 
12
- attr_reader :number
13
+ attr_accessor :number
13
14
 
14
15
  def initialize()
15
- @url = 'https://receive-smss.com/'
16
- get_smsnum()
17
- end
18
16
 
19
- def read()
17
+ @url = 'https://receive-smss.com/'
20
18
 
21
- url = @url + 'sms/' + @number + '/'
22
- doc = Nokorexi.new(url).to_doc
23
- table = doc.root.element('//table')
19
+ doc = Nokorexi.new(@url).to_doc
24
20
 
25
- a = table.xpath('tbody/tr').map do |x|
26
- x.xpath('td').map {|y| y.plaintext }
21
+ @a = doc.root.xpath('//a[@class="number-boxes1-item-button"]').map do |x|
22
+ x.attributes[:href][/\d+/]
27
23
  end
28
24
 
29
- a.map {|x| %i(from text date).zip(x).to_h }
25
+ get_smsnum()
26
+ end
30
27
 
28
+ def number()
29
+ @number = @a.sample
31
30
  end
32
31
 
33
- private
32
+ def numbers()
33
+ @a
34
+ end
34
35
 
35
- def get_smsnum()
36
+ def read(number=@number)
36
37
 
37
- doc = Nokorexi.new(@url).to_doc
38
+ url = @url + 'sms/' + number + '/'
39
+ doc = Nokorexi.new(url).to_doc
40
+ table = doc.root.element('//table')
38
41
 
39
- a = doc.root.xpath('//a[@class="number-boxes1-item-button"]').map do |x|
40
- x.attributes[:href]
42
+ a = table.xpath('tbody/tr').map do |x|
43
+ x.xpath('td').map {|y| y.plaintext.strip }
41
44
  end
42
45
 
43
- @number = a.first[/\d+/]
46
+ a.map {|x| OpenStruct.new(%i(from text date).zip(x).to_h) }
47
+
44
48
  end
45
49
 
46
50
  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.0
4
+ version: 0.1.3
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