⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 found it.kon

📁 Yahoo!search API. 用于搜索引擎接口
💻 KON
📖 第 1 页 / 共 4 页
字号:
				frameHeight = Number(node.evaluate( "string(Thumbnail/Height)" )) + 16;				if ( frameHeight < 70 ) frameHeight = 70;				rightOffset = (maxWidth - Number(node.evaluate( "string(Thumbnail/Width)" )))/2;				itemFrame.width = 425;// -- START FRAME								image = new Image();				image.hOffset = rightOffset + 5;				image.vOffset = 6;				image.src = "Images/imageBoxTopLeft.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + 18;				image.vOffset = 6;				image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;				image.src = "Images/imageBoxTop.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;				image.vOffset = 6;				image.src = "Images/imageBoxTopRight.png";				itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + 5;				image.vOffset = 18;				image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;				image.src = "Images/imageBoxLeft.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + 18;				image.vOffset = 18;				image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;				image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;				image.src = "Images/imageBoxFill.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;				image.vOffset = 18;				image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;				image.src = "Images/imageBoxRight.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + 5;				image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;				image.src = "Images/imageBoxBottomLeft.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + 18;				image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;				image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;				image.src = "Images/imageBoxBottom.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;				image = new Image();				image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;				image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;				image.src = "Images/imageBoxBottomRight.png";								itemFrame.addSubview( image );				itemFrameViews.background = image;// -- END FRAME								image = new Image();				image.hAlign = "center";				image.vAlign = "center";				image.hOffset = rightOffset + 8 + Math.floor(Number(node.evaluate( "string(Thumbnail/Width)" ))/2);				image.vOffset = 8 + Math.floor(Number(node.evaluate( "string(Thumbnail/Height)" ))/2);				image.remoteAsync = true;				image.loadingSrc = "Images/loading.png";				image.src = node.evaluate( "string(Thumbnail/Url)" );								itemFrame.addSubview( image );				itemFrameViews.background = image;				text = new Text();				text.color = "#000000";				text.font = "Arial Bold";				text.size = 14;				text.data = node.evaluate( "string(Title)" );				text.hOffset = maxWidth + 15;				text.vOffset = 16;				text.width = 245;				text.truncation = "end";				text.href = $qv( node.evaluate("string(RefererUrl)") );				text.onMouseUp = (function (){ 					openURL( this.href );				});				itemFrame.addSubview( text );				itemFrameViews.title = text;				text = new TextArea();				text.color = "#616161";				text.font = "Arial";				text.size = 11;				text.data = node.evaluate( "string(Summary)" );				text.hOffset = maxWidth + 10;				text.vOffset = 22;				text.width = 240;				text.editable = false;				text.scrollbar = false;				tmpTextHeight = text.vOffset + text.height;				itemFrame.addSubview( text );				itemFrameViews.address = text;				text = new TextArea();				text.color = "#108409";				text.font = "Arial";				text.size = 11;				text.data = node.evaluate( "string(Url)" );				text.hOffset = maxWidth + 10;				text.vOffset = tmpTextHeight + 3;				text.width = 240;				text.editable = false;				text.scrollbar = false;				text.href = $qv( node.evaluate( "string(ClickUrl)" ) );				text.onMouseUp = (function (){					openURL( this.href );				});												if ( (text.vOffset + text.height) > frameHeight )					frameHeight = text.vOffset + text.height + 10;				itemFrame.addSubview( text );				itemFrameViews.city = text;				// Our list item is complete, add it to the main frame in the right position				itemFrame.vOffset = heightOffset;				if ( subItem%2 )				{					image = new Image();					image.src = "Images/darkRow.png";					image.hOffset = 0;					image.vOffset = 0;					image.width = 425;					image.height = frameHeight;					image.zOrder = 0;										itemFrame.addSubview( image );					itemFrameViews.background = image;				}				itemFrame.height = frameHeight;				heightOffset += frameHeight;								itemArray[itemArray.length] = itemFrame; // hold onto this so it doesn't get garbage collected				itemList.addSubview( itemFrame );								subItem++;				itemsAdded++;			}		}		function getShoppingSearch(what)		{			mySearchData = url.fetch("http://api.shopping.yahoo.com/ShoppingService/V1/productSearch?appid=Konfabulator&query=" + escape(what) + "&results=" + howMany);			var xml = XMLDOM.parse( mySearchData );						var subItem = 0;			var itemsAdded = 0;			var results = xml.evaluate( "ResultSet/Result/Catalog | ResultSet/Result/Offer" );						var heightOffset = 0;			itemArray = new Array();			itemList.scrollY = 0;						maxWidth = 70;			merchantList = "";			if (results.length == 0)			{				noResults.visible = true;				return;			}			for (n = 0; n < results.length; n++)			{				var node = results.item(n);				if ( Number(node.evaluate( "string(Thumbnail/Width)" )) > maxWidth)					maxWidth = Number(node.evaluate( "string(Thumbnail/Width)" ));				if ( node.evaluate( "string(Merchant/@ID)" ).length == 7 )				{					merchantList += "&merchantid=" + node.evaluate( "string(Merchant/@ID)" );					print (node.evaluate( "string(Merchant/@ID)" ));				}			}			myMerchantData = url.fetch("http://api.shopping.yahoo.com/ShoppingService/v1/MerchantSearch?appid=Konfabulator" + merchantList);			print ("http://api.shopping.yahoo.com/ShoppingService/v1/MerchantSearch?appid=Konfabulator" + merchantList);			print (myMerchantData);			var merchantXml = XMLDOM.parse( myMerchantData );			for (n = 0; n < results.length; n++)			{				var itemFrame = new Frame();				var itemFrameViews = new Array();				var image = null;				var text = null;								var node = results.item(n);				itemFrame.width = 425;// -- START FRAME								if ( node.evaluate( "string(Thumbnail/Height)" ) )				{					frameHeight = Number(node.evaluate( "string(Thumbnail/Height)" )) + 16;					if ( frameHeight < 70 ) frameHeight = 70;						rightOffset = (maxWidth - Number(node.evaluate( "string(Thumbnail/Width)" )))/2;									image = new Image();					image.hOffset = rightOffset + 5;					image.vOffset = 6;					image.src = "Images/imageBoxTopLeft.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + 18;					image.vOffset = 6;					image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;					image.src = "Images/imageBoxTop.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;					image.vOffset = 6;					image.src = "Images/imageBoxTopRight.png";						itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + 5;					image.vOffset = 18;					image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;					image.src = "Images/imageBoxLeft.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + 18;					image.vOffset = 18;					image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;					image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;					image.src = "Images/imageBoxFill.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;					image.vOffset = 18;					image.height = Number(node.evaluate( "string(Thumbnail/Height)" )) - 20;					image.src = "Images/imageBoxRight.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + 5;					image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;					image.src = "Images/imageBoxBottomLeft.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + 18;					image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;					image.width = Number(node.evaluate( "string(Thumbnail/Width)" )) - 20;					image.src = "Images/imageBoxBottom.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;						image = new Image();					image.hOffset = rightOffset + Number(node.evaluate( "string(Thumbnail/Width)" )) - 2;					image.vOffset = Number(node.evaluate( "string(Thumbnail/Height)" )) - 2;					image.src = "Images/imageBoxBottomRight.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;										image = new Image();					image.hAlign = "center";					image.vAlign = "center";					image.width = node.evaluate( "string(Thumbnail/Width)" );					image.height = node.evaluate( "string(Thumbnail/Height)" );					image.hOffset = rightOffset + 8 + Math.floor(Number(node.evaluate( "string(Thumbnail/Width)" ))/2);					image.vOffset = 8 + Math.floor(Number(node.evaluate( "string(Thumbnail/Height)" ))/2);					image.remoteAsync = true;					//image.loadingSrc = "Images/loading.png";					image.src = node.evaluate( "string(Thumbnail/Url)" );										itemFrame.addSubview( image );					itemFrameViews.background = image;				}				else				{					frameHeight = 72;						rightOffset = (maxWidth/2);					image = new Image();					image.hAlign = "center";					image.vAlign = "center";					image.hOffset = rightOffset + 8;					image.vOffset = 33;					image.src = "Images/noImage.png";										itemFrame.addSubview( image );					itemFrameViews.background = image;				}// -- END FRAME								text = new Text();				text.color = "#0000c1";				text.font = "Arial Bold";				text.size = 14;				text.data = node.evaluate( "string(ProductName)" );				text.hOffset = maxWidth + 15;				text.vOffset = 16;				text.width = 385 - maxWidth;				text.truncation = "end";				text.href = $qv( node.evaluate( "string(Url)" ) );				text.onMouseUp = (function (){					openURL( this.href );				});				itemFrame.addSubview( text );				itemFrameViews.title = text;								if ( node.evaluate( "string(Price)" ))				{					text = new Text();					text.color = "#000000";					text.font = "Arial Bold";					text.size = 12;					text.data = "$" + node.evaluate( "string(Price)" );					text.hOffset = maxWidth + 15;					text.vOffset = 32;					tempHpos = text.width + text.hOffset + 6;										itemFrame.addSubview( text );					itemFrameViews.title = text;					text = new Text();					text.color = "#108409";					text.font = "Arial";					text.size = 12;					text.data = node.evaluate( "string(Merchant/Name)" );					text.hOffset = tempHpos;					text.vOffset = 32;										itemFrame.addSubview( text );					itemFrameViews.title = text;				}				else				{					text = new Text();					text.color = "#000000";					text.font = "Arial Bold";					text.size = 12;					text.data = "$" + node.evaluate( "string(PriceFrom)" ) + " - $" + node.evaluate( "string(PriceTo)" ) ;					text.hOffset = maxWidth + 15;					text.vOffset = 32;					tempHpos = text.width + text.hOffset + 10;										itemFrame.addSubview( text );					itemFrameViews.title = text;				}				ratingIsThere = false;				if ( node.evaluate( "string(Merchant)" ) )				{					if ( node.evaluate( "string(Merchant/@ID)" ).length == 7 )					{						try // This needs to be here thanks to a bug in the Shopping API.						{							var merchantResults = merchantXml.evaluate( 'MerchantResultSet/Merchant[@ID="' + node.evaluate( "string(Merchant/@ID)" ) + '"]' );							var merchantNode = merchantResults.item(0);														if ( merchantNode.evaluate( "string(Rating/NumRatings)" ) != "0" )								ratingValue = ( Math.floor( ( Number( merchantNode.evaluate( "string(Rating/OverallRating)" ) ) * 2 ) ) ) / 2;							else								ratingValue = "none";														image = new Image();							image.src = "Images/" + ratingValue + ".png";							image.hOffset = maxWidth + 15;							image.vOffset = 38;							image.href = $qv( node.evaluate( "string(Rating/RatingUrl)" ) );							image.onMouseUp = (function (){								openURL( this.href );							});							itemFrame.addSubview( image );							itemFrameViews.background = image;														text = new Text();							text.color = "#000000";							text.font = "Arial";							text.size = 11;							text.data = "Merchant Rating" ;							text.hOffset = maxWidth + 85;							text.vOffset = 48;							text.href = $qv( node.evaluate( "string(Rating/RatingUrl)" ) );							text.onMouseUp = (function (){								openURL( this.href );							});							itemFrame.addSubview( text );							itemFrameViews.title = text;														ratingIsThere = true;													}						catch ( e )						{							// Nothing to do here.						}					}				}				else				{					if ( node.evaluate( "string(UserRating/NumRatings)" ) != "0" )						ratingValue = ( Math.floor( ( Number( node.evaluate( "string(UserRating/AverageRating)" ) ) * 2 ) ) ) / 2;					else						ratingValue = "none";					image = new Image();					image.src = "Images/" + ratingValue + ".png";					image.hOffset = maxWidth + 15;					image.vOffset = 38;					image.href = $qv( node.evaluate( "string(UserRating/RatingUrl)" ) );					image.onMouseUp = (function (){						openURL( this.href );					});					itemFrame.addSubview( image );					itemFrameViews.background = image;										text = new Text();					text.color = "#000000";					text.font = "Arial";					text.size = 11;					text.data = "Product Reviews (" + node.evaluate( "string(UserRating/NumRatings)" ) + ")";					text.hOffset = maxWidth + 85;					text.vOffset = 48;					text.href = $qv( node.evaluate( "string(UserRating/RatingUrl)" ) );					text.onMouseUp = (function (){						openURL( this.href );					});					itemFrame.addSubview( text );					itemFrameViews.title = text;										ratingIsThere = true;				}				text = new TextArea();				text.color = "#616161";				text.font = "Arial";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -