国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
添加 RSS 聯(lián)合供稿

RSS 聯(lián)合供稿使用 <feed> 元素。以下是 CNN 新聞聯(lián)合供稿的示例:

<feed refresh-interval="1800">http://rss.cnn.com/rss/cnn_topstories.rss</feed>

獲取這些更新聯(lián)合供稿的協(xié)議為 Atom 1.0、Atom 0.3、RSS 2.0 或 RSS 1.0。標(biāo)準(zhǔn)聯(lián)合供稿通常都會(huì)正常運(yùn)行。

使用聯(lián)合供稿更新按鈕圖標(biāo)/工具提示

要通過(guò)聯(lián)合供稿更新工具欄上的圖標(biāo)或工具提示說(shuō)明,您需要將特定工具欄擴(kuò)展件添加到使用名稱空間的 RSS 或 ATOM。下面是從聯(lián)合供稿中提取的心情圈圈按鈕的示例:

<?xml version="1.0" encoding="utf-8"?><custombuttons xmlns="http://toolbar.google.com/custombuttons/"><button><title>Mood ring</title><description>Your virtual mood ring</description><site>http://www.google.com/search?q=mood+ring</site><feed menu="false" refresh-interval="900">http://www.example.com/custombuttons/samples/feeds/mood</feed></button></custombuttons>

注意,它指定 menu="false" 表示此聯(lián)合供稿僅用于更新圖標(biāo)和工具提示,而不能填充子項(xiàng)目的下拉菜單。

如果在實(shí)際的服務(wù)器上安裝了它,聯(lián)合供稿輸出則如下所示:

<?xml version=‘1.0‘?><feed xmlns=‘http://www.w3.org/2005/Atom‘xmlns:gtb=‘http://toolbar.google.com/custombuttons/‘><id>http://www.example.com/custombuttons/samples/feeds/mood</id><title>Mood</title><link href=‘http://www.google.com/search?q=+ring‘ /><link rel=‘self‘href=‘http://www.example.com/custombuttons/samples/feeds/mood‘ /><gtb:description>Bluegreen:Inner emotions charged, somewhat relaxed</gtb:description><gtb:icon mode="base64" type="image/x-icon">AAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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49pp/97SSv/czS//yb0q4wAAAE8AAAAAAAAAAF54hhNrq77BXpCj/7+7Of/czjH/3tFH/+bdeP/w7cv/9PLa/+zlnf/g1VP/1so5/mBfJHsAAAArAAAAAAAAAAAAAAABa5GgIHWst/dymG3/3tE//9/UUv/o4Ij/9PHT//v67P/v6a3/08xY/3uMX6UAAAAuAAAAEAAAAAAAAAAAAAAAAAAAAAKSvb9YSoWa+WyagP+wv2X/4NRO/+ngfv/m4Zf/rLeB+lpubIkAAAAlAAAADgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAoqvuDxkkp2gYo+c51mHkv9lk5v/Y4eNtlBfaEgAAAAWAAAACQAAAAIAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAwAAAAMAAAADgAAAA8AEAAA==</gtb:icon></feed>

以上示例是 Atom 1.0 聯(lián)合供稿,包含的 Google 自定義按鈕名稱空間指定為:

xmlns:gtb=‘http://toolbar.google.com/custombuttons/‘

要覆蓋隨按鈕出現(xiàn)的工具提示,請(qǐng)指定:

<gtb:description> new-description </gtb:description>

要覆蓋隨按鈕出現(xiàn)的圖標(biāo),請(qǐng)指定:

<gtb:icon> icon-base64-code </gtb:icon>

控制這種復(fù)雜的“心情”分析系統(tǒng)的 PHP 腳本如下所示:

<?phpheader(‘Content-type: text/xml‘);switch(rand(1, 7)) {case 1:$icon = "amber.ico";$desc = "Amber:\nNervous, on edge, uncertain";break;case 2:$icon = "black.ico";$desc = "Black:\nTense, stressed, working too hard";break;case 3:$icon = "blue.ico";$desc = "Blue:\nComfortable, breeze, at rest, loveable";break;case 4:$icon = "bluegreen.ico";$desc = "Bluegreen:\nHeightened inner emotional state, moderately relaxed";break;case 5:$icon = "gray.ico";$desc = "Gray:\nAnxious, ill at ease, strained";break;case 6:$icon = "green.ico";$desc = "Green:\nSteady, stable, no emotional turmoil";brea;case 7:$icon = "purple.ico";$desc = "Dark Blue:\nImpassioned, delighted, whiff of romance";break;}$icon = base64_encode(file_get_contents($icon));echo "<?xml version=‘1.0‘?>";echo "\n<feed xmlns=‘http://www.w3.org/2005/Atom‘ xmlns:gtb=‘http://toolbar.google.com/custombuttons/‘>";echo "\n<id>http://www.example.com/custombuttons/samples/feeds/mood</id>";echo "\n<title>Mood</title>";echo "\n<link href=‘http://www.google.com/search?q=$mood+ring‘ />";echo "\n<link rel=‘self‘ href=‘http://www.example.com/custombuttons/samples/feeds/mood‘ />";echo "\n<gtb:description>$desc</gtb:description>";echo "\n<gtb:icon mode=‘base64‘ type=‘image/x-icon‘>$icon</gtb:icon>";echo "\n</feed>";?>

圖標(biāo)應(yīng)該和腳本位于同一文件夾中。

使用聯(lián)合供稿更新按鈕和下拉菜單圖標(biāo)

您還可以將自定義服務(wù)器圖標(biāo)添加到聯(lián)合供稿下拉菜單上的單個(gè)項(xiàng)目上。下面是天氣按鈕示例,它具有包含下拉菜單(默認(rèn)值)的聯(lián)合供稿,但是還可以指定 refresh-menuitem="false" 隱藏隨時(shí)連接到服務(wù)器的刷新菜單項(xiàng)目。這樣可以提供更加簡(jiǎn)潔的外觀。

 

<?xml version="1.0" encoding="utf-8"?><custombuttons xmlns="http://toolbar.google.com/custombuttons/"><button><title>Weather 94043</title><description>Weather updates for Mountain View, CA</description><site>http://www.google.com/search?q=weather+94043&num=1</site><feed refresh-interval="3600" refresh-menuitem="false">http://www.example.com/custombuttons/samples/feeds/weather?zip=94043</feed></button></custombuttons>

 

下面是天氣聯(lián)合供稿外觀的示例,在下拉菜單中各個(gè)菜單項(xiàng)目旁邊都有自定義圖標(biāo)(為簡(jiǎn)潔起見,大多數(shù)圖標(biāo)已經(jīng)刪除 base64 編碼的資料)?;谝陨鲜纠梢娪冢?code>http://www.example.com/custombuttons/samples/feeds/weather/?zip=94043

<?xml version=‘1.0‘?><feed xmlns=‘http://www.w3.org/2005/Atom‘xmlns:gtb=‘http://toolbar.google.com/custombuttons/‘><id>http://www.example.com/custombuttons/samples/feeds/weather</id><title>Weather Mountain View, CA</title><link href=‘http://www.google.com/search?q=weather+94043/‘ /><link rel=‘self‘href=‘http://www.example.com/custombuttons/samples/feeds/weather‘ /><gtb:description>Mountain View, CA63F Mostly CloudyHumidity: 48%Wind: NW at 8 mph</gtb:description><gtb:icon mode=‘base64‘ type=‘image/x-icon‘>R0lGODlhKAAoANUAAEuc/Pz8/Fik/Ii00k9daZGPivLy8tbW1k2R0uvr6wZj3HSq0f/QMMfHx7a2tj2F0fu0EePj4yx81neUp4J/eKanphJq3IJtOGB3iI3C5BFt5B5XnWis7H2346jO5/6+IWKo8923... and so on...</gtb:icon><entry><title>Today: Mostly Cloudy 65 | 50</title><link href=‘http://www.google.com/search?q=weather+94043/‘ /><id>http://www.example.com/custombuttons/samples/feeds/weather/0</id><gtb:icon mode=‘base64‘ type=‘image/x-icon‘>R0lGODlhKAAoANUAAEuc/Pz8/Fik/Ii00k9daZGPivLy8tbW1k2R0uvr6wZj3HSq0f/QMMfHx7a2tj2F0fu0EePj4yx81neUp4J/eKanphJq3IJtOGB3iI3C5BFt5B5XnWis7H2346jO5/6+IWKo8923... and so on...</entry><entry><title>Thu:  66 | 51</title><link href=‘http://www.google.com/search?q=weather+94043/‘ /><id>http://www.example.com/custombuttons/samples/feeds/weather/1</id><gtb:icon mode=‘base64‘ type=‘image/x-icon‘>R0lGODlhKAAoAPcAAAAAAP///4WOwPT1+tDT3unr8sHG1ff5/6Wy0mZ8rGqAr3mJrJakxa+zvHSKtcDBw1R2slBql110njBXjztmqS9OfjtekTZWhGeJuoqctklLTgJYyQJQtQ9hzhRr3BZlzBVRoS1S... and so on...</gtb:icon></entry><entry><title>Fri:  67 | 51</title><link href=‘http://www.google.com/search?q=weather+94043/‘ /><id>http://www.example.com/custombuttons/samples/feeds/weather/2</id><gtb:icon mode=‘base64‘ type=‘image/x-icon‘>R0lGODlhKAAoANUAAObm52ms7k2Q0Uuc/Fmk+v2zDoS01HOp0avP5tvb26CPXQZj3DqG14yLh05YYf/IKv/VN3mCiMPDw6SkpCt82GhxePz8/JG+2pd5NRZu3hBq3fb29rCAFrm5uSN549OWE4WltqHI... and so on...</gtb:icon></entry><entry><title>Sat:  67 | 50</title><link href=‘http://www.google.com/search?q=weather+94043/‘ /><id>http://www.example.com/custombuttons/samples/feeds/weather/3</id><gtb:icon mode=‘base64‘ type=‘image/x-icon‘>R0lGODlhKAAoANUAAObm52ms7k2Q0Uuc/Fmk+v2zDoS01HOp0avP5tvb26CPXQZj3DqG14yLh05YYf/IKv/VN3mCiMPDw6SkpCt82GhxePz8/JG+2pd5NRZu3hBq3fb29rCAFrm5uSN549OWE4WltqHI... and so on...</gtb:icon></entry></feed>

為此,PHP 代碼使用天氣預(yù)報(bào)回復(fù)格式。

<?php// Script to convert Google xml weather interface to custom buttons AtomFeed 1.0// Sample input at http://www.google.com/ig/api?weather=94043// To see sample output, run this script with ?zip=94043$zip = $_GET[‘zip‘];header(‘Content-type: text/xml‘);// http://www.google.com/ig/api?weather=94043$dom= domxml_open_file("http://www.google.com/ig/api?weather=$zip");$xpath = xpath_new_context($dom);// $params = $dom->documentElement->firstChild->getElementsByTagName(‘param‘);$temp = $xpath->xpath_eval(‘//city/@data‘);$city = $temp->nodeset[0]->value;$icons = $xpath->xpath_eval(‘//current_conditions/icon/@data‘);$icon_url = $icons->nodeset[0]->value;$icon = base64_encode(file_get_contents("http://www.google.com$icon_url"));$conditions = $xpath->xpath_eval(‘//current_conditions/condition/@data‘);$condition = $conditions->nodeset[0]->value;$temp = $xpath->xpath_eval(‘//current_conditions/temp_f/@data‘);$tempf = $temp->nodeset[0]->value;$temp = $xpath->xpath_eval(‘//current_conditions/humidity/@data‘);$humidity = $temp->nodeset[0]->value;$temp = $xpath->xpath_eval(‘//current_conditions/wind_condition/@data‘);$wind = $temp->nodeset[0]->value;echo "<?xml version=‘1.0‘?>";echo "\n<feed xmlns=‘http://www.w3.org/2005/Atom‘ ";echo     "xmlns:gtb=‘http://toolbar.google.com/custombuttons/‘>";echo "\n<id>http://www.example.com/custombuttons/samples/feeds/weather</id>";echo "\n<title>Weather $city</title>";echo "\n<link href=‘http://www.google.com/search?q=weather+$zip/‘ />";echo "\n<link rel=‘self‘ href=‘http://www.example.com/custombuttons/";echo     "samples/feeds/weather‘ />";echo "\n<gtb:description>$city\n$tempfF $condition\n$humidity\n$wind";echo   "</gtb:description>";echo "\n<gtb:icon mode=‘base64‘ type=‘image/x-icon‘>$icon</gtb:icon>";$days = $xpath->xpath_eval(‘//forecast_conditions/day_of_week/@data‘);$conditions = $xpath->xpath_eval(‘//forecast_conditions/condition/@data‘);$icons = $xpath->xpath_eval(‘//forecast_conditions/icon/@data‘);$highs = $xpath->xpath_eval(‘//forecast_conditions/high/@data‘);$lows = $xpath->xpath_eval(‘//forecast_conditions/low/@data‘);for ($i = 0; $i < count($conditions->nodeset); $i++) {$day_of_week = $days->nodeset[$i]->value;$condition = $conditions->nodeset[$i]->value;$high = $highs->nodeset[$i]->value;$low = $lows->nodeset[$i]->value;echo "\n<entry>";echo "\n<title>$day_of_week: $condition $high | $low</title>";echo "\n<link href=‘http://www.google.com/search?q=weather+$zip/‘ />";echo "\n<id>http://www.example.com/custombuttons/samples/feeds/weather/$i</id>";$icon_url = $icons->nodeset[$i]->value;$icon = base64_encode(file_get_contents("http://www.google.com$icon_url"));echo "\n<gtb:icon mode=‘base64‘ type=‘image/x-icon‘>$icon</gtb:icon>";echo "\n</entry>";}echo "\n</feed>";?>

您還可以使用相同的 http://toolbar.google.com/custombuttons/ 名稱空間和說(shuō)明或者 RSS 1.0、RSS 2.0、Atom 1.0 及 Atom 0.3 聯(lián)合供稿中的圖標(biāo)標(biāo)記用于工具欄聯(lián)合供稿。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
當(dāng)設(shè)計(jì)一個(gè)APP UI的時(shí)候我們想什么?
推薦個(gè)bootstrap的icon圖標(biāo)網(wǎng)站
【精品資源】圖標(biāo) ICON 下載網(wǎng)站來(lái)一波
Fluid app: 把任意網(wǎng)頁(yè)做成獨(dú)立程序 可以在狀態(tài)欄顯示
在你的blog上加上Google訂閱圖標(biāo) - 蒯義剛::網(wǎng)志 - 記錄、分享、交流 - KuaiYigang‘s Blog
制作自己的Email Icon
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服