<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://dwt.life/feed/rss/tag/Google-Service/">
<title>dwt&#039;s life - Google Service</title>
<link>https://dwt.life/tag/Google-Service/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://dwt.life/archives/314/"/>
<rdf:li resource="https://dwt.life/archives/308/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://dwt.life/archives/314/">
<title>谷歌下拉联想词接口</title>
<link>https://dwt.life/archives/314/</link>
<dc:date>2022-10-18T17:37:39+08:00</dc:date>
<description>接口一http://suggestqueries.google.com/complete/search?client=firefox&amp;q=YOURQUERY&amp;callback=接口二https://www.google.com/complete/search?client=hp&amp;hl=en&amp;sugexp=msedr&amp;gs_rn=62&amp;gs_ri=hp&amp;cp=1&amp;gs_id=9c&amp;q=a&amp;xhr=t&amp;callback=hellocallback参数可以去掉或者改成jsonp&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;

&lt;script&gt;
/* this function shows the raw data */
function myAmazingFunction(data){
    document.getElementById(&#039;output&#039;).innerHTML = data;
}
&lt;/script&gt;

&lt;script src=&quot;https://www.google.com/complete/search?client=hp&amp;hl=en&amp;sugexp=msedr&amp;gs_rn=62&amp;gs_ri=hp&amp;cp=1&amp;gs_id=9c&amp;q=a&amp;xhr=t&amp;callback=hello&amp;callback=myAmazingFunction&quot;&gt;&lt;/script&gt;</description>
</item>
<item rdf:about="https://dwt.life/archives/308/">
<title>PHP Google merchant 添加商品</title>
<link>https://dwt.life/archives/308/</link>
<dc:date>2022-09-04T12:13:00+08:00</dc:date>
<description>&lt;?php
require_once &#039;vendor/autoload.php&#039;;

putenv(&#039;GOOGLE_APPLICATION_CREDENTIALS=Merchant-Center-XXXXXx.json&#039;);

$client = new Google_Client();
$client-&gt;useApplicationDefaultCredentials();

$client-&gt;addScope(&#039;https://www.googleapis.com/auth/content&#039;);

$service = new Google_Service_ShoppingContent($client);

$product = new Google_Service_ShoppingContent_Product();
$product-&gt;setOfferId(&#039;book123&#039;);
$product-&gt;setTitle(&#039;A Tale of Two Cities&#039;);
$product-&gt;setDescription(&#039;A classic novel about the French Revolution&#039;);
$product-&gt;setLink(&#039;http://my-book-shop.com/tale-of-two-cities.html&#039;);
$product-&gt;setImageLink(&#039;http://my-book-shop.com/tale-of-two-cities.jpg&#039;);
$product-&gt;setContentLanguage(&#039;en&#039;);
$product-&gt;setTargetCountry(&#039;GB&#039;);
$product-&gt;setChannel(&#039;online&#039;);
$product-&gt;setAvailability(&#039;in stock&#039;);
$product-&gt;setCondition(&#039;new&#039;);
$product-&gt;setGoogleProductCategory(&#039;Media &gt; Books&#039;);
$product-&gt;setGtin(&#039;9780007350896&#039;);

$price = new Google_Service_ShoppingContent_Price();
$price-&gt;setValue(&#039;2.50&#039;);
$price-&gt;setCurrency(&#039;GBP&#039;);

$shipping_price = new Google_Service_ShoppingContent_Price();
$shipping_price-&gt;setValue(&#039;0.99&#039;);
$shipping_price-&gt;setCurrency(&#039;GBP&#039;);

$shipping = new Google_Service_ShoppingContent_ProductShipping();
$shipping-&gt;setPrice($shipping_price);
$shipping-&gt;setCountry(&#039;GB&#039;);
$shipping-&gt;setService(&#039;Standard shipping&#039;);

$shipping_weight = new Google_Service_ShoppingContent_ProductShippingWeight();
$shipping_weight-&gt;setValue(200);
$shipping_weight-&gt;setUnit(&#039;grams&#039;);

$product-&gt;setPrice($price);
$product-&gt;setShipping(array($shipping));
$product-&gt;setShippingWeight($shipping_weight);

$result = $service-&gt;products-&gt;insert($merchant_id, $product);</description>
</item>
</rdf:RDF>