fofa 0.3.13 → 0.3.15

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: 46230a00b448e0d6fa729755b2d1b3c03c5450c5
4
- data.tar.gz: 7841106b219d240133f9741f4618df11349dcede
3
+ metadata.gz: 3702c8e5ab5d5135d9fbb5a704d664a5e1204ae3
4
+ data.tar.gz: 84e1115974c19064259ee09203955b018721098c
5
5
  SHA512:
6
- metadata.gz: d758ac844158fb49512e24c36587c4ff22562c5ddf33d7f5fa028d383b2dcc8d79262937917cdafe56b6481273857d98129a8ede3335072dadf04e0e494127da
7
- data.tar.gz: 935ca8c4e45adf3835057f0a6bda9050e9049686ec7971de51b90e9a5e76e95207b529d299c5177b282268695c6a9b8baf97013c8a1052b4bf2183224d8dd72f
6
+ metadata.gz: 5d311b9c353802d07313c945b7a1d89e06dac4cc794d2a34b486b42ae9f90a69c3eb66bb6df79ade84c13c71ae1efbdac711ff09118daefb9d1ec8ebd8f27890
7
+ data.tar.gz: 05dafa6ddca51d34bc9a9723e83762b4a2e7aaca0bd31f012220d8ec5171394f7b12dc93f18bc8a683cde3061d8bba64ef337dd99453a4d9c563f58957963a60
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fofa (0.3.12)
4
+ fofa (0.3.14)
5
5
  colorize
6
6
  concurrent-ruby
7
7
 
@@ -1,6 +1,7 @@
1
1
  require "fofa/version"
2
2
  require 'net/http'
3
3
  require 'json'
4
+ require 'base64'
4
5
 
5
6
  module Fofa
6
7
  class API
@@ -29,7 +30,7 @@ module Fofa
29
30
  options = {page:1, size:100, fields:'host'}.merge(options)
30
31
 
31
32
  url = "#{@api_server}/api/v1/search/all?key=#{@apikey}&email=#{@email}&page=#{options[:page]}&size=#{options[:size]}&fields=#{options[:fields]}"
32
- url += "&q=#{URI.escape(query)}" unless options[:post]
33
+ url += "&qbase64=#{Base64.encode64(query)}" unless options[:post]
33
34
  puts url if @options[:debug]
34
35
  uri = URI.parse(url)
35
36
  http = Net::HTTP.new(uri.host, uri.port)
@@ -47,6 +48,7 @@ module Fofa
47
48
  resp = http.request(req)
48
49
  JSON.parse(resp.body)
49
50
  rescue => e
51
+ $stderr.puts "[WARNING]: #{e.to_s}"
50
52
  {"error"=>"Error: #{e.to_s}"}
51
53
  end
52
54
 
@@ -1,3 +1,9 @@
1
+ # 0.3.15
2
+ # fixed query encode bug of '&&'
3
+ #
4
+ # 0.3.14
5
+ # fixed bug of search_all yield when size reached
6
+ #
1
7
  # 0.3.13
2
8
  # search_all yield with all size
3
9
  #
@@ -19,5 +25,5 @@
19
25
  # 0.3.6
20
26
  # add fields
21
27
  module Fofa
22
- VERSION = "0.3.13"
28
+ VERSION = "0.3.15"
23
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - fofa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.6.3
125
+ rubygems_version: 2.6.12
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: A Ruby library to interact with the FOFA API. https://fofa.so