예제 #1
0
if ($ORGANISATION_NAME == null) {
    echo "<strong>Case 1 : Create Insightly Organisation</strong><br/>";
    $url = "https://api.insight.ly/v2.1/Organisations";
    $org_json = '[{"ORGANISATION_ID":65011707,"ORGANISATION_NAME":"Go Green Paperless Initative","BACKGROUND":"Mobile","IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/538797/6R3T10/361db35f-5536-467d-b65b-5014ea3a8707.png","OWNER_USER_ID":930301,"DATE_CREATED_UTC":"2015-09-04 15:41:27","DATE_UPDATED_UTC":"2015-09-18 20:05:49","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[{"CUSTOM_FIELD_ID":"ORGANISATION_FIELD_1","FIELD_VALUE":"Professional Services"}],"ADDRESSES":[{"ADDRESS_ID":32934893,"ADDRESS_TYPE":"WORK","STREET":"110 Sunset Ave","CITY":"Harrisburg","STATE":"PA","POSTCODE":"17112","COUNTRY":null}],"CONTACTINFOS":[{"CONTACT_INFO_ID":70616116,"TYPE":"WEBSITE","SUBTYPE":null,"LABEL":"WORK","DETAIL":"http://www.gogreenpaperlessinitiative.com/"},{"CONTACT_INFO_ID":70616117,"TYPE":"EMAILDOMAIN","SUBTYPE":null,"LABEL":"WORK","DETAIL":"gogreenpaperlessinitiative.com"},{"CONTACT_INFO_ID":70616157,"TYPE":"WEBSITE","SUBTYPE":null,"LABEL":"CORPORATE","DETAIL":"https://www.linkedin.com/company/1012911?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A1012911%2Cidx%3A1-1-1%2CtarId%3A1441381360674%2Ctas%3AGo%20Green%20Paperl"},{"CONTACT_INFO_ID":70616238,"TYPE":"PHONE","SUBTYPE":null,"LABEL":"WORK","DETAIL":"800-688-5641"}],"DATES":[],"TAGS":[],"LINKS":[{"LINK_ID":88453259,"CONTACT_ID":140592679,"OPPORTUNITY_ID":null,"ORGANISATION_ID":65011707,"PROJECT_ID":null,"SECOND_PROJECT_ID":null,"SECOND_OPPORTUNITY_ID":null,"ROLE":"President","DETAILS":null},{"LINK_ID":94245541,"CONTACT_ID":150060612,"OPPORTUNITY_ID":null,"ORGANISATION_ID":65011707,"PROJECT_ID":null,"SECOND_PROJECT_ID":null,"SECOND_OPPORTUNITY_ID":null,"ROLE":"Web and App Developer","DETAILS":null}],"ORGANISATIONLINKS":[],"EMAILLINKS":[]}]';
    $result = Curl_Post($url, $org_json);
    echo $result;
}
//--------------------------------------------------------------------
//------------------------ Get Contact ID-----------------------------
//--------------------------------------------------------------------
$email_addr = "*****@*****.**";
$url_str1 = "https://api.insight.ly/v2.1/contacts?";
$url_str2 = $url_str1 . "email=" . $email_addr;
//$url = substr($url_str, 0, -2);
echo "URL = " . $url_str2 . "<br/><br/>";
$result = Curl_Get($url_str2);
echo $result;
$json_readr = json_decode($result);
$contact_id = $json_readr[0]->{"CONTACT_ID"};
echo "<br/><br/> Contact_id = " . $contact_id;
echo "<br/><br/>";
//--------------------------------------------------------------------
//------------------------ Create Contact-----------------------------
//--------------------------------------------------------------------
//https://api.insight.ly/v2.1/Help/Api/GET-Tags-id
//to get list of tags
if ($contact_id == null) {
    echo "<strong>Case 1 : Create Insightly Contact</strong><br/>";
    $json = '{
	  "SALUTATION": "Mr",
	  "FIRST_NAME": "William",
예제 #2
0
/*
amacms接口
*/
//设置头部
header("Content-type:text/html;charset=UTF-8");
//包含数据库文件
include 'conn.php';
include 'config.php';
//获取Keywords
$keywords = $_GET['keywords'];
//开始调用API
$request = aws_signed_request($amacountry, array('Operation' => 'ItemSearch', 'Keywords' => $keywords, 'SearchIndex' => 'All', 'ResponseGroup' => 'Medium'), $public_key, $private_key, $associate_tag);
//访问Api地址
// $response = Curl_Get($request);
$response = Curl_Get('http://localhost/jiekou/xml.xml');
//解析xml
if ($response === FLASE) {
    echo "Request failed.\n";
} else {
    $pxml = simplexml_load_string($response);
    $Item_Arr = $pxml->Items;
    $Item_Arr = json_encode($Item_Arr);
    $Item_Arr = json_decode($Item_Arr, true);
    // $retrun_arr =array();
    $New_Arr = array();
    foreach ($Item_Arr['Item'] as $key => $value) {
        // array_push($return_arr['ASIN'],$value->ASIN);
        /*
        print 'ASIN: '.$value['ASIN']."<br>";//ASIN ASIN码
        print 'IMAGE: '.$value['LargeImage']['URL']."<br>";//image 图片
예제 #3
0
        $New_Arr[$key]['Label'] = $value['ItemAttributes']['Label'];
        $New_Arr[$key]['ProductGroup'] = $value['ItemAttributes']['ProductGroup'];
        $New_Arr[$key]['ProductTypeName'] = $value['ItemAttributes']['ProductTypeName'];
        $New_Arr[$key]['Title'] = $value['ItemAttributes']['Title'];
        $New_Arr[$key]['FormattedPrice'] = $value['ItemAttributes']['ListPrice']['FormattedPrice'];
        $New_Arr[$key]['Content'] = $value['EditorialReviews']['EditorialReview']['Content'];
    }
    // foreach (GetReKeywords(10) as $key => $value) {
    //     $New_Arr['keywords'][$key] = $value;
    // }
}
$url = 'http://localhost/jiekou/jiekou.php';
// Curl_Get($url);
$weburl = 'http://www.baidu.com';
$associate_tag = 'chengxuequan-20';
$return = json_decode(Curl_Get($url), true);
shuffle($return['item']);
//打乱数组
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="ie ie8" lang="en-US"> <![endif]-->
<!--[if IE 9]> <html class="ie ie9" lang="en-US"> <![endif]-->
<!--[if gt IE 9]><!-->
<html lang="en-US">
 <!--<![endif]-->
 <head> 
  <meta charset="UTF-8" /> 
  <title>  Advanced Home</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1" />  
  <link rel="stylesheet" id="motive-fonts-css" href="http://fonts.googleapis.com/css?family=Source+Sans+Pro%3A400%2C600%2C700%7COpen+Sans%3A400%2C400italic%2C600%2C700%7CRoboto%3A900" type="text/css" media="all" /> 
  <link rel="stylesheet" id="motive-core-css" href="http://<?php