Project

zoomeye

0.0
No commit activity in last 3 years
No release in over 3 years
zoomeye api for ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
 Project Readme

zoomeye

zoomeye api for ruby.

Install

gem install zoomeye

Reference

As the official website, the interfaces provided encapsulation are below:

  • login

login with username and password, get an access token. for the details, please read the official api doc: https://www.zoomeye.org/api/doc#user

  • resources_info

get resources info for account. for the details, please read the official api doc:

https://www.zoomeye.org/api/doc#resources-info

  • host_search

search the host devices. for the details, please read the official api doc:

https://www.zoomeye.org/api/doc#host-search

  • web_search

search the web technologies. for the details, please read the official api doc:

[https://www.zoomeye.org/api/doc#web-search] (https://www.zoomeye.org/api/doc#web-search)

normally, a dict type is returned when call all above apis, except the 'login' api.

Exception

class ZoomEyeError < StandardError
  attr_reader :code, :desc
  def initialize(code, desc)
    @code = code      # string: http status code
    @desc = desc      # string: http message
  end

  # return exceptial mesesage.
  def message
    "[#{@code}]#{@desc}"
  end
end

Example

#!/usr/bin/ruby -w
# -*- coding: utf-8 -*-
require 'zoomeye'

if __FILE__ == $0
  begin
    ze = ZoomEye.new(("foo@bar.com", "foopass")
    ze.login
    puts ze.resources_info
    puts ze.host_search("port:80", 7, "app,device")
    puts ze.web_search("port:21", 1, "webapp,os")
  rescue => e
    puts e.message
  end
end