Skip to content

Instantly share code, notes, and snippets.

@adamdilek
Created January 12, 2012 17:50
Show Gist options
  • Select an option

  • Save adamdilek/1602042 to your computer and use it in GitHub Desktop.

Select an option

Save adamdilek/1602042 to your computer and use it in GitHub Desktop.
Example RUBY Code for Validation API
require 'json'
require 'net/http'
require 'uri'
def get(base_url)
url="#{base_url}"
response=Net::HTTP.get_response(URI.parse(url))
data=response.body
result=JSON.parse(data)
return result
end
puts "Tc No ?"
tc = gets.chomp
data=get("http://pigon.ws/validation/tc/?tcno=#{tc}")
puts data['success']
puts "Credit Card No ?"
credit_card_no = gets.chomp
data=get("http://pigon.ws/validation/credit_card/?ccno=#{credit_card_no}")
puts data['success']
puts "Email ?"
email = gets.chomp
data=get("http://pigon.ws/validation/email/?email=#{email}")
puts data['success']
puts "Url ?"
url = gets.chomp
data=get("http://pigon.ws/validation/url_checker/?url=#{url}")
puts data['success']
puts "Ip adress ?"
ip = gets.chomp
data=get("http://pigon.ws/validation/ip_checker/?ip=#{ip}")
puts data['success']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment