passivedns-client 2.1.1 → 2.1.2

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
  SHA1:
3
- metadata.gz: d8943fdb2df184fb90081be44049edc69a35ac80
4
- data.tar.gz: 409d45d5b94c4ab0c1d3d3e7caa57d2e192add8d
3
+ metadata.gz: b2704c1947fe2e901f15df1e319b9c657250f994
4
+ data.tar.gz: a1f063290540270511faf0dd946edd52dac429da
5
5
  SHA512:
6
- metadata.gz: 0b4d1bee2454906a09b5af88a48a3792ad0e9bdb032512362c7803f66ee12352bbe9ccf36e476fe5a406498d89e413588d2778650151480bb01d66a8e295dec3
7
- data.tar.gz: 086a9fdf306f2c67c8ff7ace94fa36e14d07a1d8631931d8d22c32c5b9295bcb79d20b433e3e074de3d1a7ed2e2c13930ec8305104b90c23dd9b3c88b0bbb0f3
6
+ metadata.gz: d19198f809806ba2745f7503c7f240a610ff7cf3bed844c1a467d64f8d5d0809ef8469c5e7f49f2eb50c170cf4944b7b01ae601298f1d8c8a5cd7b63139491cc
7
+ data.tar.gz: 06f72a7f4ff2c946ce61ea261a7337acbb002de81d1e0d5743c949b97c2e66f01129ba3d08d826515f0c174607941fee510d0cbc011b52faaeb2e8ee0f7e31e6
@@ -92,7 +92,6 @@ module PassiveDNS #:nodoc: don't document this
92
92
  # parses the response of circl's JSON reply to generate an array of PDNSResult
93
93
  def parse_json(page,query,response_time=0)
94
94
  res = []
95
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
96
95
  page.split(/\n/).each do |line|
97
96
  row = JSON.parse(line)
98
97
  firstseen = Time.at(row['time_first'].to_i)
@@ -89,7 +89,6 @@ module PassiveDNS #:nodoc: don't document this
89
89
  # parses the response of 360.cn's JSON reply to generate an array of PDNSResult
90
90
  def parse_json(page,query,response_time=0)
91
91
  res = []
92
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
93
92
  data = JSON.parse(page)
94
93
  data.each do |row|
95
94
  time_first = (row["time_first"]) ? Time.at(row["time_first"].to_i) : nil
@@ -86,7 +86,6 @@ module PassiveDNS #:nodoc: don't document this
86
86
  def parse_json(page,response_time)
87
87
  res = []
88
88
  raise "Error: unable to parse request" if page =~ /Error: unable to parse request/
89
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
90
89
  rows = page.split(/\n/)
91
90
  rows.each do |row|
92
91
  record = JSON.parse(row)
@@ -78,7 +78,6 @@ module PassiveDNS #:nodoc: don't document this
78
78
  # parses the response of mnemonic's JSON reply to generate an array of PDNSResult
79
79
  def parse_json(page,query,response_time=0)
80
80
  res = []
81
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
82
81
  data = JSON.parse(page)
83
82
  if data['result']
84
83
  data['result'].each do |row|
@@ -87,8 +86,8 @@ module PassiveDNS #:nodoc: don't document this
87
86
  answer = row['answer']
88
87
  rrtype = row['type'].upcase
89
88
  tty = row['ttl'].to_i
90
- firstseen = row['first']
91
- lastseen = row['last']
89
+ firstseen = Time.at(row['first'].to_i)
90
+ lastseen = Time.at(row['last'].to_i)
92
91
  res << PDNSResult.new(self.class.name,response_time,
93
92
  query, answer, rrtype, ttl, firstseen, lastseen)
94
93
  end
@@ -79,13 +79,10 @@ module PassiveDNS #:nodoc: don't document this
79
79
  # parses the response of passivetotals's JSON reply to generate an array of PDNSResult
80
80
  def parse_json(page,query,response_time=0)
81
81
  res = []
82
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
83
82
  data = JSON.parse(page)
84
83
  if data['results']
85
84
  query = data['results']['value']
86
85
  data['results']['resolutions'].each do |row|
87
- #p row['firstSeen']
88
- #p row['lastSeen']
89
86
  first_seen = (row['firstSeen'] == "None") ? nil : Time.parse(row['firstSeen']+" +0000")
90
87
  last_seen = (row['lastSeen'] == "None") ? nil : Time.parse(row['lastSeen']+" +0000")
91
88
  value = row['value']
@@ -104,9 +104,7 @@ module PassiveDNS #:nodoc: don't document this
104
104
  # parses the response of riskiq's JSON reply to generate an array of PDNSResult
105
105
  def parse_json(page,query,response_time=0)
106
106
  res = []
107
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
108
107
  data = JSON.parse(page)
109
- #pp data
110
108
  if data['records']
111
109
  data['records'].each do |record|
112
110
  name = record['name'].gsub!(/\.$/,'')
@@ -83,7 +83,6 @@ module PassiveDNS #:nodoc: don't document this
83
83
  # parses the response of virustotal's JSON reply to generate an array of PDNSResult
84
84
  def parse_json(page,query,response_time=0)
85
85
  res = []
86
- # need to remove the json_class tag or the parser will crap itself trying to find a class to align it to
87
86
  data = JSON.parse(page)
88
87
  if data['resolutions']
89
88
  data['resolutions'].each do |row|
@@ -2,6 +2,6 @@ module PassiveDNS # :nodoc:
2
2
  # coodinates the lookups accross all configured PassiveDNS providers
3
3
  class Client
4
4
  # version of PassiveDNS::Client
5
- VERSION = "2.1.1"
5
+ VERSION = "2.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passivedns-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chrislee35