{
"@http_status_code": 200,
"@records_count": 20,
"@records_available": 150,
"warnings": [],
"query": {
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"display": "California, US"
}
],
"emails": [
{
"address": "John@mysite.com",
"address_md5": "561f4b92651c46709fe3ab7b30dde8a6"
}
]
},
"person": {
"@query_params_match": true,
"sources": [
{
"@is_sponsored": false,
"url": "http://www.twitter.com/johndoe",
"domain": "twitter.com",
"name": "Micro Blog - Twitter",
"category": "personal_profiles"
},
{
"@is_sponsored": false,
"url": "http://www.linkedin.com/pub/7/318/33",
"domain": "linkedin.com",
"name": "Professional Profile & Networking - LinkedIn",
"category": "personal_profiles"
}
],
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"city": "California"
}
],
"emails": [
{
"address": "John@mysite.com",
"address_md5": "561f4b92651c46709fe3ab7b30dde8a6"
},
{
"address_md5": "8b4941f0f407593c1a592b3743dfc4dd"
}
],
"jobs": [
{
"title": "Owner/Developer",
"organization": "MyApp",
"display": "Owner/Developer at MyApp"
},
{
"title": "Marketing & Developer",
"organization": "The Elite Group",
"industry": "Automotive industry",
"date_range": {
"start": "2008-03-01",
"end": "2011-02-05"
},
"display": "Marketing & Developer at The Elite Group (2008-2011, Automotive industry)"
},
{
"title": "Marketing & Development",
"organization": "Musicstop/Long & McQuade",
"industry": "Music industry",
"date_range": {
"start": "2006-08-01",
"end": "2008-03-01"
},
"display": "Marketing & Development at Musicstop/Long & McQuade (2006-2008, Music industry)"
},
{
"title": "Prepress Manager",
"organization": "Wayside Press",
"industry": "Printing industry",
"date_range": {
"start": "2003-05-01",
"end": "2005-07-01"
},
"display": "Prepress Manager at Wayside Press (2003-2005, Printing industry)"
},
{
"title": "Marketing and Design",
"organization": "Sport Mart Discount Superstores",
"industry": "Sporting Goods industry",
"date_range": {
"start": "1996-07-01",
"end": "2003-03-01"
},
"display": "Marketing and Design at Sport Mart Discount Superstores (1996-2003, Sporting Goods industry)"
}
],
"images": [
{
"url": "http://a0.twimg.com/profile_images/1642851159/MyApp_logo.png"
},
{
"url": "http://media.linkedin.com/mpr/mpr/shrink_80_80/p/3/000/068/243/2655a7.jpg"
}
],
"usernames": [
{
"content": "MyApp"
}
],
"user_ids": [
{
"content": "326804197"
},
{
"content": "21682987"
},
{
"content": "7/318/37"
}
],
"related_urls": [
{
"content": "http://www.MyApp.ca"
}
],
"tags": [
{
"@classification": "About Me",
"content": "Automotive Marketing"
},
{
"@classification": "Interest",
"content": "career opportunities"
},
{
"@classification": "Interest",
"content": "consulting offers"
},
{
"@classification": "Interest",
"content": "new ventures"
}
]
},
"records": [
{
"@query_params_match": false,
"@query_person_match": 1.0,
"source": {
"@is_sponsored": false,
"url": "http://www.twitter.com/MyApp",
"domain": "twitter.com",
"name": "Micro Blog - Twitter",
"category": "personal_profiles"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "CA",
"state": "NS",
"city": "Halifax",
"display": "Halifax, NS, CA"
}
],
"images": [
{
"url": "http://a0.twimg.com/profile_images/1642851159/MyApp_logo.png"
}
],
"usernames": [
{
"content": "MyApp"
}
],
"user_ids": [
{
"content": "326804197"
}
],
"related_urls": [
{
"content": "http://www.MyApp.ca"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 1.0,
"source": {
"@is_sponsored": false,
"url": "http://www.linkedin.com/pub/7/318/37",
"domain": "linkedin.com",
"name": "Professional Profile & Networking - LinkedIn",
"category": "personal_profiles"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "CA",
"city": "Halifax",
"display": "Halifax, Canada"
}
],
"jobs": [
{
"title": "Owner/Developer",
"organization": "MyApp",
"display": "Owner/Developer at MyApp"
},
{
"title": "Marketing & Developer",
"organization": "The Elite Group",
"industry": "Automotive industry",
"date_range": {
"start": "2008-03-01",
"end": "2011-02-05"
},
"display": "Marketing & Developer at The Elite Group (2008-2011, Automotive industry)"
},
{
"title": "Marketing & Development",
"organization": "Musicstop/Long & McQuade",
"industry": "Music industry",
"date_range": {
"start": "2006-08-01",
"end": "2008-03-01"
},
"display": "Marketing & Development at Musicstop/Long & McQuade (2006-2008, Music industry)"
},
{
"title": "Prepress Manager",
"organization": "Wayside Press",
"industry": "Printing industry",
"date_range": {
"start": "2003-05-01",
"end": "2005-07-01"
},
"display": "Prepress Manager at Wayside Press (2003-2005, Printing industry)"
},
{
"title": "Marketing and Design",
"organization": "Sport Mart Discount Superstores",
"industry": "Sporting Goods industry",
"date_range": {
"start": "1996-07-01",
"end": "2003-03-01"
},
"display": "Marketing and Design at Sport Mart Discount Superstores (1996-2003, Sporting Goods industry)"
}
],
"images": [
{
"url": "http://media.linkedin.com/mpr/mpr/shrink_80_80/p/3/000/068/243/2655a67.jpg"
}
],
"user_ids": [
{
"content": "21682987"
},
{
"content": "7/318/37"
}
],
"tags": [
{
"@classification": "About Me",
"content": "Automotive Marketing"
},
{
"@classification": "Interest",
"content": "career opportunities"
},
{
"@classification": "Interest",
"content": "consulting offers"
},
{
"@classification": "Interest",
"content": "new ventures"
},
{
"@classification": "Interest",
"content": "business deals"
},
{
"@classification": "Interest",
"content": "getting back in touch"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_9341991.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "KY",
"city": "Cecilia",
"display": "Cecilia, KY, US"
}
],
"jobs": [
{
"title": "Head Coach",
"organization": "Hardin County Schools",
"display": "Head Coach at Hardin County Schools"
}
],
"tags": [
{
"content": "John Doe, Cecilia, KY, Hardin County Schools"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_9417986.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "IA",
"city": "Clarksville",
"display": "Clarksville, IA, US"
}
],
"jobs": [
{
"title": "Principal",
"organization": "Clarksville Elementary School",
"display": "Principal at Clarksville Elementary School"
}
],
"tags": [
{
"content": "John Doe, t***@clarksville.k12.ia.us, Clarksville, IA, Clarksville Elementary School"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"city": "Granada Hills",
"display": "Granada Hills, CA, US"
},
{
"country": "US",
"state": "WI",
"display": "Wisconsin, US"
}
],
"tags": [
{
"content": "Re: Verdun Doe/Janet Breen. Posted on: 12 Mar 2007, by. . tmkeeps05. Localities North America United States States Wisconsin Counties Marathon ... Schofield, and Tom (Linda) Doe ... six grandchildren, Terry Doe II John Doe. Tom Doe, Jr. Tim Doe, Tiffany Doe, Tara Doe; and one great grandson"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "KY",
"display": "Kentucky, US"
},
{
"country": "US",
"state": "TN",
"city": "Memphis",
"display": "Memphis, TN, US"
}
],
"tags": [
{
"content": "Buren Garten Jr. Posted on: 19 Dec 2000, by. . akygirl2. Localities North America United States States Kentucky Counties Woodford. a founder of the Bluegrass Wildwater Association. In addition to his wife, he is survived by a son John Doe. of Memphis ... two daughters, Lynna Jo Nicholas, Oak Ridge, Tenn and J D. Garten of Lexingt"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_8620391.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "UT",
"city": "Holladay",
"display": "Holladay, UT, US"
}
],
"jobs": [
{
"title": "Vice President of Information Technology",
"organization": "JetBlue Airways",
"display": "Vice President of Information Technology at JetBlue Airways"
}
],
"tags": [
{
"content": "John Doe, Holladay, UT, JetBlue Airways"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=OzlErZ1WcKQ&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/OzlErZ1WcKQ/1.jpg"
}
],
"tags": [
{
"content": "Colbie Caillat cover song - Diana performing I Never Told You with John"
},
{
"content": "I Never Told You - Colbie Caillat cover by Diana Perkins and John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=gUQdHSoit5k&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/gUQdHSoit5k/1.jpg"
}
],
"tags": [
{
"content": "John Doe is busy training for this coming racing season. Reigning Extremity Games Silver medalist, and Adaptive X Games silver medalist, he is looking t"
},
{
"content": "John Doe 2011 promo"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/101599843028312014412/10313?authkey=yYVZs9o0yv0#5930702269116364434",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh5.ggpht.com/-Iu4f_ivLQOk/Uk4WSqNItpI/AAAAAAAAAtE/Bqw1oSj56vI/IMAG0016.jpg"
}
],
"tags": [
{
"content": "101599843028312014412 (John Doe)"
},
{
"content": "IMAG0016.jpg"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=pthFlSveAO0&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/pthFlSveAO0/1.jpg"
}
],
"tags": [
{
"content": "John Doe performing his original - Painkillers and Whiskey. John is in the band 2am Logic, check them out at: http://www.myspace.com/2amlogic http://www"
},
{
"content": "Painkillers and Whiskey - original song by John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=V752LVCF8Gk&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/V752LVCF8Gk/1.jpg"
}
],
"tags": [
{
"content": "3 beds 2 baths John Doe CENTURY 21 Wright-Pace Real Estate http://www.century21.com/property/2702-Graystone-Paragould-AR-72450-37697883"
},
{
"content": "Homes for Sale - 2702 Graystone Dr Paragould AR 72450 - John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/117315566337101422559/ProfilePhotos?authkey=EMy0dxYTmoc#5933759047647690018",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh3.ggpht.com/-Fjxbru_iK5w/UljyalnM_SI/AAAAAAAAAGc/jtuCZeoQQgs/NMCOA2K15-7.jpg"
}
],
"tags": [
{
"content": "117315566337101422559 (John Doe)"
},
{
"content": "NMCOA2K15-7.jpg"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/110673768003000772479/ProfilePhotos?authkey=LsYB12mw4zM#5937673774094327986",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh4.ggpht.com/-qO7Cp-JTKY4/Umba1qELoLI/AAAAAAAAAAk/1Wi60emUiLI/5f2df8ad-e53c-41e5-ad25-5feca59a0cc2.jpg"
}
],
"tags": [
{
"content": "110673768003000772479 (John Doe)"
},
{
"content": "5f2df8ad-e53c-41e5-ad25-5feca59a0cc2"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "NC",
"display": "North Carolina, US"
}
],
"tags": [
{
"content": "Re: Thomas John of Rowan Co. Posted on: 02 Sep 2002, by. . NancyMorris61. Localities North America United States States North Carolina Counties Rowan. The parents of the Thomas John who died in 1869 were John John, Jr ... May 1796) and Ann Brandon John Doe ... 17 Oct 1821). Ann Doe is also buried at Thyatira, in the same row with Thomas. There is i"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "NM",
"display": "New Mexico, US"
}
],
"tags": [
{
"content": "Olaf 12-18-1922 to 1-11-2001. Posted on: 16 Jan 2001, by. PJ. Localities North America United States States New Mexico Counties Chaves ... in Los Angeles. She passed away in 2000. Survivors include two sons, Eric Doe of Roswell and John Doe. of Albuquerque; one daughter, Claudia Shigemitsu of Whittier, Calif. ; three sisters, Ruth Soll"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/sirtt/video/dancing.../5411249",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a1-videos.myspacecdn.com/videos02/208/880e54c4f0b8424e9e149a2c76524bfd/300w.jpg"
}
],
"tags": [
{
"content": "dancing John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.metacafe.com/watch/mv-8t45j/snowmen_film_dont_waste_this_chance/",
"domain": "metacafe.com",
"name": "Videos - Metacafe",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://s.mcstatic.com/thumb/7139922/19768984/4/catalog_item5/0/1/snowmen_film_dont_waste_this_chance.jpg"
}
],
"tags": [
{
"content": "Snowmen (film) - Don't Waste This Chance. Topics:. Bobb'e J Doe Bobby Coleman Christian Martyn Stephen A Marinaccio II David Segel John Burns. Bill O'Kane. From the movie Snowmen - Billy (Bobby Coleman) leads a battalion of kids in ... Added 9/2/11 By MovieClips com"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/muscledaddy08/video/beast-and-the-harlot-gh2-tyler-Doe-expert/38615461",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a3-videos.myspacecdn.com/videos02/203/0880e2eab040474eab5377430ec1075c/300w.jpg"
}
],
"tags": [
{
"content": "Beast and the Harlot Gh2 Tyler Doe Expert John Crow"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/JohngDoe/video/more-brandon/10477651",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a1-videos.myspacecdn.com/videos02/201/e19c34601489478c8c50bade26351fb6/300w.jpg"
}
],
"tags": [
{
"content": "More Brandon John Doe"
}
]
}
],
"suggested_searches": []
}
$jsonSources = json_decode($response)["person"]["sources"];
foreach ($jsonSources as $source) {
$is_sponsored = $source["@is_sponsored"];
$url = $source["url"];
$domain = $source["domain"];
$name = $source["name"];
$categorie = $source["categorie"];
echo $url . " : " . $domain . "<br />";
}
<?php
$insight = json_decode($response, true); // an associative array
foreach ($response as $record) {
if (!isset($record['person']) || empty($record['person'])) {
// jump out here because "person" is empty
continue; // this will go to the next record in the loop
}
// if you get here then you have data in "person"
// deal with "sources"
if (isset($record['sources']) && !empty($record['sources'])) {
// loop each record in sources
foreach ($record['sources'] as $source) {
// not sure what you want to do with the data so I'm going to echo it out for now
echo $record['sources']['@is_sponsored'] ? 'This person is sponsored<br />' : 'This person is not sponsored<br />';
echo 'URL : ' . $record['sources']['url'] . '<br />';
echo 'Domain : ' . $record['sources']['domain'] . '<br />';
echo 'Name : ' . $record['sources']['name'] . '<br />';
echo 'Category : ' . $record['sources']['category'] . '<br />';
}
}
// deal with "jobs"
// note: jobs has a different amount of keys per record in you examplae so you would be better to loop this one slightly different.
if (isset($record['jobs']) && !empty($record['jobs'])) {
// loop each record in jobs
foreach ($record['jobs'] as $key => $value) {
echo ucfirst($key). ' : ' . $value . '<br />'; // this one line will deal with all key => value pairs
}
}
// deal with "images"
if (isset($record['images']) && !empty($record['images'])) {
// loop each record in images
foreach ($record['images'] as $image) {
echo 'URL : ' . $image['url'] . '<br />';
}
}
}
// now you have printed out everything you wanted in the response. I am guessing you don't just want to print it out but you can modify this to suit.
?>
<?php // RAY_temp_tjyoung.php
error_reporting(E_ALL);
// SEE http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28307343.html
$jso = <<<EOD
{
"@http_status_code": 200,
"@records_count": 20,
"@records_available": 150,
"warnings": [],
"query": {
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"display": "California, US"
}
],
"emails": [
{
"address": "John@mysite.com",
"address_md5": "561f4b92651c46709fe3ab7b30dde8a6"
}
]
},
"person": {
"@query_params_match": true,
"sources": [
{
"@is_sponsored": false,
"url": "http://www.twitter.com/johndoe",
"domain": "twitter.com",
"name": "Micro Blog - Twitter",
"category": "personal_profiles"
},
{
"@is_sponsored": false,
"url": "http://www.linkedin.com/pub/7/318/33",
"domain": "linkedin.com",
"name": "Professional Profile & Networking - LinkedIn",
"category": "personal_profiles"
}
],
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"city": "California"
}
],
"emails": [
{
"address": "John@mysite.com",
"address_md5": "561f4b92651c46709fe3ab7b30dde8a6"
},
{
"address_md5": "8b4941f0f407593c1a592b3743dfc4dd"
}
],
"jobs": [
{
"title": "Owner/Developer",
"organization": "MyApp",
"display": "Owner/Developer at MyApp"
},
{
"title": "Marketing & Developer",
"organization": "The Elite Group",
"industry": "Automotive industry",
"date_range": {
"start": "2008-03-01",
"end": "2011-02-05"
},
"display": "Marketing & Developer at The Elite Group (2008-2011, Automotive industry)"
},
{
"title": "Marketing & Development",
"organization": "Musicstop/Long & McQuade",
"industry": "Music industry",
"date_range": {
"start": "2006-08-01",
"end": "2008-03-01"
},
"display": "Marketing & Development at Musicstop/Long & McQuade (2006-2008, Music industry)"
},
{
"title": "Prepress Manager",
"organization": "Wayside Press",
"industry": "Printing industry",
"date_range": {
"start": "2003-05-01",
"end": "2005-07-01"
},
"display": "Prepress Manager at Wayside Press (2003-2005, Printing industry)"
},
{
"title": "Marketing and Design",
"organization": "Sport Mart Discount Superstores",
"industry": "Sporting Goods industry",
"date_range": {
"start": "1996-07-01",
"end": "2003-03-01"
},
"display": "Marketing and Design at Sport Mart Discount Superstores (1996-2003, Sporting Goods industry)"
}
],
"images": [
{
"url": "http://a0.twimg.com/profile_images/1642851159/MyApp_logo.png"
},
{
"url": "http://media.linkedin.com/mpr/mpr/shrink_80_80/p/3/000/068/243/2655a7.jpg"
}
],
"usernames": [
{
"content": "MyApp"
}
],
"user_ids": [
{
"content": "326804197"
},
{
"content": "21682987"
},
{
"content": "7/318/37"
}
],
"related_urls": [
{
"content": "http://www.MyApp.ca"
}
],
"tags": [
{
"@classification": "About Me",
"content": "Automotive Marketing"
},
{
"@classification": "Interest",
"content": "career opportunities"
},
{
"@classification": "Interest",
"content": "consulting offers"
},
{
"@classification": "Interest",
"content": "new ventures"
}
]
},
"records": [
{
"@query_params_match": false,
"@query_person_match": 1.0,
"source": {
"@is_sponsored": false,
"url": "http://www.twitter.com/MyApp",
"domain": "twitter.com",
"name": "Micro Blog - Twitter",
"category": "personal_profiles"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "CA",
"state": "NS",
"city": "Halifax",
"display": "Halifax, NS, CA"
}
],
"images": [
{
"url": "http://a0.twimg.com/profile_images/1642851159/MyApp_logo.png"
}
],
"usernames": [
{
"content": "MyApp"
}
],
"user_ids": [
{
"content": "326804197"
}
],
"related_urls": [
{
"content": "http://www.MyApp.ca"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 1.0,
"source": {
"@is_sponsored": false,
"url": "http://www.linkedin.com/pub/7/318/37",
"domain": "linkedin.com",
"name": "Professional Profile & Networking - LinkedIn",
"category": "personal_profiles"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "CA",
"city": "Halifax",
"display": "Halifax, Canada"
}
],
"jobs": [
{
"title": "Owner/Developer",
"organization": "MyApp",
"display": "Owner/Developer at MyApp"
},
{
"title": "Marketing & Developer",
"organization": "The Elite Group",
"industry": "Automotive industry",
"date_range": {
"start": "2008-03-01",
"end": "2011-02-05"
},
"display": "Marketing & Developer at The Elite Group (2008-2011, Automotive industry)"
},
{
"title": "Marketing & Development",
"organization": "Musicstop/Long & McQuade",
"industry": "Music industry",
"date_range": {
"start": "2006-08-01",
"end": "2008-03-01"
},
"display": "Marketing & Development at Musicstop/Long & McQuade (2006-2008, Music industry)"
},
{
"title": "Prepress Manager",
"organization": "Wayside Press",
"industry": "Printing industry",
"date_range": {
"start": "2003-05-01",
"end": "2005-07-01"
},
"display": "Prepress Manager at Wayside Press (2003-2005, Printing industry)"
},
{
"title": "Marketing and Design",
"organization": "Sport Mart Discount Superstores",
"industry": "Sporting Goods industry",
"date_range": {
"start": "1996-07-01",
"end": "2003-03-01"
},
"display": "Marketing and Design at Sport Mart Discount Superstores (1996-2003, Sporting Goods industry)"
}
],
"images": [
{
"url": "http://media.linkedin.com/mpr/mpr/shrink_80_80/p/3/000/068/243/2655a67.jpg"
}
],
"user_ids": [
{
"content": "21682987"
},
{
"content": "7/318/37"
}
],
"tags": [
{
"@classification": "About Me",
"content": "Automotive Marketing"
},
{
"@classification": "Interest",
"content": "career opportunities"
},
{
"@classification": "Interest",
"content": "consulting offers"
},
{
"@classification": "Interest",
"content": "new ventures"
},
{
"@classification": "Interest",
"content": "business deals"
},
{
"@classification": "Interest",
"content": "getting back in touch"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_9341991.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "KY",
"city": "Cecilia",
"display": "Cecilia, KY, US"
}
],
"jobs": [
{
"title": "Head Coach",
"organization": "Hardin County Schools",
"display": "Head Coach at Hardin County Schools"
}
],
"tags": [
{
"content": "John Doe, Cecilia, KY, Hardin County Schools"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_9417986.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "IA",
"city": "Clarksville",
"display": "Clarksville, IA, US"
}
],
"jobs": [
{
"title": "Principal",
"organization": "Clarksville Elementary School",
"display": "Principal at Clarksville Elementary School"
}
],
"tags": [
{
"content": "John Doe, t***@clarksville.k12.ia.us, Clarksville, IA, Clarksville Elementary School"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "CA",
"city": "Granada Hills",
"display": "Granada Hills, CA, US"
},
{
"country": "US",
"state": "WI",
"display": "Wisconsin, US"
}
],
"tags": [
{
"content": "Re: Verdun Doe/Janet Breen. Posted on: 12 Mar 2007, by. . tmkeeps05. Localities North America United States States Wisconsin Counties Marathon ... Schofield, and Tom (Linda) Doe ... six grandchildren, Terry Doe II John Doe. Tom Doe, Jr. Tim Doe, Tiffany Doe, Tara Doe; and one great grandson"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "KY",
"display": "Kentucky, US"
},
{
"country": "US",
"state": "TN",
"city": "Memphis",
"display": "Memphis, TN, US"
}
],
"tags": [
{
"content": "Buren Garten Jr. Posted on: 19 Dec 2000, by. . akygirl2. Localities North America United States States Kentucky Counties Woodford. a founder of the Bluegrass Wildwater Association. In addition to his wife, he is survived by a son John Doe. of Memphis ... two daughters, Lynna Jo Nicholas, Oak Ridge, Tenn and J D. Garten of Lexingt"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.lead411.com/John_Doe_8620391.html",
"domain": "lead411.com",
"name": "Executive & Business Information - Lead411",
"category": "professional_and_business"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "UT",
"city": "Holladay",
"display": "Holladay, UT, US"
}
],
"jobs": [
{
"title": "Vice President of Information Technology",
"organization": "JetBlue Airways",
"display": "Vice President of Information Technology at JetBlue Airways"
}
],
"tags": [
{
"content": "John Doe, Holladay, UT, JetBlue Airways"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=OzlErZ1WcKQ&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/OzlErZ1WcKQ/1.jpg"
}
],
"tags": [
{
"content": "Colbie Caillat cover song - Diana performing I Never Told You with John"
},
{
"content": "I Never Told You - Colbie Caillat cover by Diana Perkins and John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=gUQdHSoit5k&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/gUQdHSoit5k/1.jpg"
}
],
"tags": [
{
"content": "John Doe is busy training for this coming racing season. Reigning Extremity Games Silver medalist, and Adaptive X Games silver medalist, he is looking t"
},
{
"content": "John Doe 2011 promo"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/101599843028312014412/10313?authkey=yYVZs9o0yv0#5930702269116364434",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh5.ggpht.com/-Iu4f_ivLQOk/Uk4WSqNItpI/AAAAAAAAAtE/Bqw1oSj56vI/IMAG0016.jpg"
}
],
"tags": [
{
"content": "101599843028312014412 (John Doe)"
},
{
"content": "IMAG0016.jpg"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=pthFlSveAO0&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/pthFlSveAO0/1.jpg"
}
],
"tags": [
{
"content": "John Doe performing his original - Painkillers and Whiskey. John is in the band 2am Logic, check them out at: http://www.myspace.com/2amlogic http://www"
},
{
"content": "Painkillers and Whiskey - original song by John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.youtube.com/watch?v=V752LVCF8Gk&feature=youtube_gdata",
"domain": "youtube.com",
"name": "Video - YouTube",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://i.ytimg.com/vi/V752LVCF8Gk/1.jpg"
}
],
"tags": [
{
"content": "3 beds 2 baths John Doe CENTURY 21 Wright-Pace Real Estate http://www.century21.com/property/2702-Graystone-Paragould-AR-72450-37697883"
},
{
"content": "Homes for Sale - 2702 Graystone Dr Paragould AR 72450 - John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/117315566337101422559/ProfilePhotos?authkey=EMy0dxYTmoc#5933759047647690018",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh3.ggpht.com/-Fjxbru_iK5w/UljyalnM_SI/AAAAAAAAAGc/jtuCZeoQQgs/NMCOA2K15-7.jpg"
}
],
"tags": [
{
"content": "117315566337101422559 (John Doe)"
},
{
"content": "NMCOA2K15-7.jpg"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://picasaweb.google.com/110673768003000772479/ProfilePhotos?authkey=LsYB12mw4zM#5937673774094327986",
"domain": "picasaweb.google.com",
"name": "Web Album Photo - Picasa",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://lh4.ggpht.com/-qO7Cp-JTKY4/Umba1qELoLI/AAAAAAAAAAk/1Wi60emUiLI/5f2df8ad-e53c-41e5-ad25-5feca59a0cc2.jpg"
}
],
"tags": [
{
"content": "110673768003000772479 (John Doe)"
},
{
"content": "5f2df8ad-e53c-41e5-ad25-5feca59a0cc2"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "NC",
"display": "North Carolina, US"
}
],
"tags": [
{
"content": "Re: Thomas John of Rowan Co. Posted on: 02 Sep 2002, by. . NancyMorris61. Localities North America United States States North Carolina Counties Rowan. The parents of the Thomas John who died in 1869 were John John, Jr ... May 1796) and Ann Brandon John Doe ... 17 Oct 1821). Ann Doe is also buried at Thyatira, in the same row with Thomas. There is i"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://boards.ancestry.com/SearchResults.aspx?db=mb&gss=ancMB&hc=25&rank=0&adv=show&p=localities.northam.usa.states.tennessee.counties.mcminn&csn=McMinn&cst=board&gskw=\"John+Doe\"&psrch=&_F00029CB=&_F00027E2=&period=&_80004003=&_F0002BF1=",
"domain": "boards.ancestry.com",
"name": "Message Boards Search - Ancestry",
"category": "public_records"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"addresses": [
{
"country": "US",
"state": "NM",
"display": "New Mexico, US"
}
],
"tags": [
{
"content": "Olaf 12-18-1922 to 1-11-2001. Posted on: 16 Jan 2001, by. PJ. Localities North America United States States New Mexico Counties Chaves ... in Los Angeles. She passed away in 2000. Survivors include two sons, Eric Doe of Roswell and John Doe. of Albuquerque; one daughter, Claudia Shigemitsu of Whittier, Calif. ; three sisters, Ruth Soll"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/sirtt/video/dancing.../5411249",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a1-videos.myspacecdn.com/videos02/208/880e54c4f0b8424e9e149a2c76524bfd/300w.jpg"
}
],
"tags": [
{
"content": "dancing John Doe"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "http://www.metacafe.com/watch/mv-8t45j/snowmen_film_dont_waste_this_chance/",
"domain": "metacafe.com",
"name": "Videos - Metacafe",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "http://s.mcstatic.com/thumb/7139922/19768984/4/catalog_item5/0/1/snowmen_film_dont_waste_this_chance.jpg"
}
],
"tags": [
{
"content": "Snowmen (film) - Don't Waste This Chance. Topics:. Bobb'e J Doe Bobby Coleman Christian Martyn Stephen A Marinaccio II David Segel John Burns. Bill O'Kane. From the movie Snowmen - Billy (Bobby Coleman) leads a battalion of kids in ... Added 9/2/11 By MovieClips com"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/muscledaddy08/video/beast-and-the-harlot-gh2-tyler-Doe-expert/38615461",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a3-videos.myspacecdn.com/videos02/203/0880e2eab040474eab5377430ec1075c/300w.jpg"
}
],
"tags": [
{
"content": "Beast and the Harlot Gh2 Tyler Doe Expert John Crow"
}
]
},
{
"@query_params_match": false,
"@query_person_match": 0.98405,
"source": {
"@is_sponsored": false,
"url": "https://www.myspace.com/JohngDoe/video/more-brandon/10477651",
"domain": "myspace.com",
"name": "Videos - MySpace",
"category": "media"
},
"names": [
{
"first": "John",
"last": "Doe",
"display": "John Doe"
}
],
"images": [
{
"url": "https://a1-videos.myspacecdn.com/videos02/201/e19c34601489478c8c50bade26351fb6/300w.jpg"
}
],
"tags": [
{
"content": "More Brandon John Doe"
}
]
}
],
"suggested_searches": []
}
EOD;
// MAKE AN OBJECT AND VISUALIZE IT
$obj = json_decode($jso);
echo '<pre>';
var_dump($obj);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://api.pipl.com/search/v3/json/?email='.$email.'&first_name='.$firstname.'&last_name='.$lastname.'&city='.$city.'&state='.$state.'&country=CA&key=mykey&pretty=true',
CURLOPT_TIMEOUT => 50,
CURLOPT_CONNECTTIMEOUT => 0,
CURLOPT_HEADER => 'false'
));
$response = curl_exec($curl);
curl_close($curl);
$insight = json_decode($response, true); // an associative array
//var_dump($insight);
foreach ($response as $record) {
if (!isset($record['person']) || empty($record['person'])) {
continue; // this will go to the next record in the loop
}
if (isset($record['sources']) && !empty($record['sources'])) {
// loop each record in sources
foreach ($record['sources'] as $source) {
// not sure what you want to do with the data so I'm going to echo it out for now
echo 'URL : ' . $record['sources']['url'] . '<br />';
echo 'Domain : ' . $record['sources']['domain'] . '<br />';
echo 'Name : ' . $record['sources']['name'] . '<br />';
echo 'Category : ' . $record['sources']['category'] . '<br />';
}
}
// deal with "jobs"
// note: jobs has a different amount of keys per record in you examplae so you would be better to loop this one slightly different.
if (isset($record['jobs']) && !empty($record['jobs'])) {
// loop each record in jobs
foreach ($record['jobs'] as $key => $value) {
echo ucfirst($key). ' : ' . $value . '<br />'; // this one line will deal with all key => value pairs
}
}
// deal with "images"
if (isset($record['images']) && !empty($record['images'])) {
// loop each record in images
foreach ($record['images'] as $image) {
echo 'URL : ' . $image['url'] . '<br />';
}
}
}
I'm struggling to see where that line comes from?
Open in new window
A good online tools : http://jsonviewer.stack.hu/