Created
January 12, 2012 17:50
-
-
Save adamdilek/1602042 to your computer and use it in GitHub Desktop.
Example RUBY Code for Validation API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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