Ok I'm working with the following code:
$userGuid = "2d7c4ca4-d1b6-4c2a-9106-33df1251d946";
$apiKey = "wuZBiCx2jWwbNJgw88M6jJvxp0LYBBG9o/cxgHZx+cdNVKaPnMASmbdbj/4oVrch5NZZlPULad0pamUar9kUrA==";
function query($connectorGuid, $input, $userGuid, $apiKey, $additionalInput) {
$url = "https://api.import.io/store/connector/" . $connectorGuid . "/_query?_user=" . urlencode($userGuid) . "&_apikey=" . urlencode($apiKey);
$data = array("input" => $input);
if ($additionalInput) {
$data["additionalInput"] = $additionalInput;
}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
curl_close($ch);
return json_decode($result, true);
}
// Query for tile Teams and Links
$result = query("3997cc2e-4fce-4431-89da-0dc542d83b84", array(
"webpage/url" => "http://msn.foxsports.com/foxsoccer/bundesliga/teams",
), $userGuid, $apiKey, false);
var_dump($result);
That returns the following:
array(6) {
["offset"] => int(0)["results"] => array(18) {
[0] => array(5) {
["stats_link/_source"] => string(52)
"/foxsoccer/bundesliga/teams/1-fc-nurnberg/stats/5131" ["team_name"] => string(14)
"1. FC Nurnberg" ["stats_link/_title"] => string(28)
"Stats - 1. FC Nurnberg Stats" ["stats_link/_text"] => string(5)
"Stats" ["stats_link"] => string(76)
"http://msn.foxsports.com/foxsoccer/bundesliga/teams/1-fc-nurnberg/stats/5131"
}[1] => array(5) {
["stats_link/_source"] => string(54)
"/foxsoccer/bundesliga/teams/1899-hoffenheim/stats/6859" ["team_name"] => string(15)
"1899 Hoffenheim" ["stats_link/_title"] => string(29)
"Stats - 1899 Hoffenheim Stats" ["stats_link/_text"] => string(5)
"Stats" ["stats_link"] => string(78)
"http://msn.foxsports.com/foxsoccer/bundesliga/teams/1899-hoffenheim/stats/6859"
and continues on for a however long.
I need to get the [team_name] and [stats_link] values out of that array. I've seen a number of examples on here, but the code I'm working with uses a function first and that's where I get confused. Any help is greatly appreciated. Thank you.
team_nameandstats_linkremoved or you want to use them someplace else ?