-
-
Save lemusthelroy/0a7fd7dcc6ceda3d9195fd95f41ef5c3 to your computer and use it in GitHub Desktop.
EmailPie Samples
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
// An invalid domain. | |
// http://emailpie.com/v1/[email protected] | |
{ | |
"didyoumean": null, | |
"errors": [ | |
{ | |
"message": "No MX records found for the domain.", | |
"severity": 7 | |
} | |
], | |
"success": false | |
} | |
// A poorly formatted email. | |
// http://emailpie.com/v1/check?email=invalidemail | |
{ | |
"didyoumean": null, | |
"errors": [ | |
{ | |
"message": "Invalid email address.", | |
"severity": 10 | |
}, | |
{ | |
"message": "No MX records found for the domain.", | |
"severity": 7 | |
} | |
], | |
"success": false | |
} | |
// A good, but possibly misspelled email. | |
// http://emailpie.com/v1/[email protected] | |
{ | |
"didyoumean": "[email protected]", | |
"errors": [], | |
"success": true | |
} | |
// Finally, a good email! | |
// http://emailpie.com/v1/[email protected] | |
{ | |
"didyoumean": null, | |
"errors": [], | |
"success": true | |
} |
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
$ch = curl_init(); | |
$email = "[email protected]"; | |
$qs = "email=" . urlencode($email); | |
$url = "http://emailpie.com/v1/check?" . $qs; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
$data = json_decode(curl_exec($ch)); | |
curl_close($ch); | |
echo $data; |
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
import requests | |
import simplejson | |
email = '[email protected]' | |
params = {'email': email} | |
response = requests.get('http://emailpie.com/v1/check', params=params) | |
response = simplejson.loads(response.content) | |
print(response) |
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 'rubygems' | |
require 'json' | |
require 'net/http' | |
require 'CGI' | |
email = "[email protected]" | |
base_url = "http://emailpie.com/v1/check" | |
url = "#{base_url}?email=#{CGI::escape(email)}" | |
resp = Net::HTTP.get_response(URI.parse(url)) | |
result = JSON.parse(resp.body) | |
puts result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment