Skip to content

Instantly share code, notes, and snippets.

@deependersingla
Created November 25, 2015 11:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deependersingla/2d7cb893d3b7b4b464bd to your computer and use it in GitHub Desktop.
Save deependersingla/2d7cb893d3b7b4b464bd to your computer and use it in GitHub Desktop.
using truecaller using script
require 'net/http'
require "json"
number = ARGV[0]
unless defined? number
raise "number not given"
end
url = "https://search5.truecaller.com/v2/search?client_id=1&clientId=1&countryCode=in&locAddr=&myNumber=#{api_key}&pageId=&q=#{number}&registerId=94435922&type=4"
uri = URI(url)
data = Net::HTTP.get(uri)
data = JSON.parse(data)
puts "Name: #{data["data"][0]["name"]}"
puts "Gender: #{data["data"][0]["gender"]}"
puts "Address: #{data["data"][0]["addresses"][0]["address"]}"
@rs414057
Copy link

rs414057 commented Feb 1, 2016

@rs414057
Copy link

@gowrishankar27
Copy link

sir. api_key is undefined :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment