<% Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 // get the cart information from the session variables CartID=session.contents("CartID") HMAC=session.contents("HMAC") PurchaseURL=session.contents("PurchaseURL") // if no cart, create one with a dummy order if CartID="" then xmlURL = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0RCHSVYRXEJ8389AM782&Operation=CartCreate&Item.1.ASIN=818253075X&Associate-id=jbst%2d20&Item.1.Quantity=1&ResponseGroup=Cart" Set xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlHTTP.Open "GET", xmlURL, False xmlHTTP.Send // Check if everything is okay If xmlHTTP.Status = 200 Then xmlResponse = xmlHTTP.ResponseXML.xml // Load the XML parser Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM") xmlDoc.Async = False xmlDoc.loadXML (xmlResponse) CartID="" HMAC="" Set objLst = xmlDoc.getElementsByTagName("*") For i = 0 to (objLst.length - 1) if objLst.item(i).nodename="CartId" then CartID=objLst.item(i).text if objLst.item(i).nodename="URLEncodedHMAC" then HMAC=objLst.item(i).text if objLst.item(i).nodename="PurchaseURL" then PurchaseURL=objLst.item(i).text //response.write objLst.item(i).nodename & ": " & objlst.item(i).text & "
---------------------
" //response.write objLst.item(i).nodename & "
Text: " & objLst.item(i).text & "
-----
" next end if // since we created a dummy cart, we need to store off the information in a session variable so we wont lose it if CartID <> "" then Session.Contents("CartID")=CartID Session.Contents("HMAC")=HMAC Session.Contents("PurchaseURL")=PurchaseURL // now we can clear the cart to get rid of the dummy order xmlURL = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0RCHSVYRXEJ8389AM782&Operation=CartClear&CartId=" & CartID & "&HMAC=" & HMAC & "&ResponseGroup=Request,Cart" xmlHTTP.Open "GET", xmlURL, False xmlHTTP.Send end if //Set xmlHTTP=Nothing end if ' CartID=NULL // At this point, we have a cart, if it wasn't here when we got here, we created and emptied it Set dataConn = Server.CreateObject("ADODB.Connection") dataConn.ConnectionString = db_strConn dataConn.Open strSQL="Select pagecount from pagecounters where id=3" set tmpr=dataConn.execute(strSQL) tmpr.movefirst() pcount=tmpr("PageCount") tmpr.close() set tmpr=nothing pcount=pcount+1 strSQL="Update PageCounters set pagecount=" & PCount & " where id=3" dataConn.execute(strSQL) strSQL="Select asin,amazon,imageSource,CCNow,OtherSource,ImageSource,Title,ISBN,Description from AmazonSales order by Ordinal" set BookAsins=dataConn.execute(strSQL) theASINs=BookAsins.getRows() BookAsins.Close() set BookAsins=Nothing //theID=Request.QueryString("theID") //if theID="" then theID="818253075X" If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") > 0 Then Response.ContentType = "application/xhtml+xml" Else Response.ContentType = "text/html" End If Response.Charset = "utf-8" %> JBStillwater: Amazon Bookstore

JB Stillwater's Amazon Bookstore

For Direct Sales and discounts on books by Casa de Snapdragon, go to the listing at JB Direct

Amazon Book Search   Max of 10 Results 
View Cart
View Cart
<% for A=LBOUND(theASINs,2) to UBOUND(theASINs,2) theTitle=theASINs(6,A) theEAN=theASINS(7,A) theISBN=theASINS(7,A) theImage=theASINS(2,A) thePublisher="Need" thePubDate="Need" theBinding="Need" theDescription="Need" thePrice="Need" theAuthor="Need" theSalesRank=0 theResponseGroup="N/A" theOtherSource=theASINS(4,A) MediumImage="" SmallImage="" theCurrencyCode="USD" NumPages="0" ReleaseDate="" //if theTitle="A Chicken Soup for the Soul Christmas (Chicken Soup for the Soul)" then BkDesc=theASINS(8) if theASINS(1,A)=true then theSalesRank=0 theImage="" if theASINS(0,A)="0757306462" then BkDesc=theASINS(8,A) else BkDesc="" end if xmlURL = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0RCHSVYRXEJ8389AM782&AssociateID=jbst-20&Operation=ItemLookup&ItemId=" & theASINs(0,A) & "&ResponseGroup=Images,ItemAttributes,SalesRank,EditorialReview" Set xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlHTTP.Open "GET", xmlURL, False xmlHTTP.Send // Check if everything is okay If xmlHTTP.Status = 200 Then xmlResponse = xmlHTTP.ResponseXML.xml // Load the XML parser Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM") xmlDoc.Async = False xmlDoc.loadXML (xmlResponse) Set objLst = xmlDoc.getElementsByTagName("*") FoundImage=0 theOtherSource="" For i = 0 to (objLst.length - 1) //if theASINS(0,A)="0757306462" then //response.write "" & objLst.item(i).nodename & ": " & objlst.item(i).text & "
---------------------
" //response.write "" & objLst.item(i).nodename & "
Text: " & objLst.item(i).text & "
-----
" //end if select case objLst.item(i).nodeName case "Title" theTitle=objLst.item(i).text theTitle=replace(theTitle,"
","
") theTitle=replace(theTitle,"
","
") theTitle=replace(theTitle,"
","
") case "EAN" theEAN=objLst.item(i).text case "ISBN" theISBN=objLst.item(i).text case "Manufacturer" thePublisher=objLst.item(i).text thePublisher=replace(thePublisher,"&","and") case "PublicationDate" thePubDate=objLst.item(i).text case "Binding" theBinding=objLst.item(i).text case "SmallImage" SmallImage=left(objLst.item(i).text,instr(objlst.item(i).text,".jpg")+3) FoundImage=1 case "MediumImage" MediumImage=left(objLst.item(i).text,instr(objlst.item(i).text,".jpg")+3) foundImage2=1 case "Content" if theASINS(0,A)<>"0757306462" then theDescription=objLst.item(i).text theDescription=replace(theDescription,"
","
") theDescription=replace(theDescription,"
","
") theDescription=replace(theDescription,"
","
") else theDescription=theASINS(8,A) theDescription=replace(theDescription,"
","
") theDescription=replace(theDescription,"
","
") theDescription=replace(theDescription,"
","
") end if case "FormattedPrice" thePrice=objLst.item(i).text case "Author" theAuthor=objLst.item(i).text case "SalesRank" theSalesRank=objLst.item(i).text case "CurrencyCode" theCurrencyCode=objLst.item(i).text case "NumberOfPages" NumPages=objLst.item(i).text case "ReleaseDate" ReleaseDate="" case "EditorialReview" if theASINS(0,A)<>"0757306462" then BKDesc=objLst.item(i).text BKDesc=replace(BKDesc,"
","
") BKDesc=replace(BKDesc,"
","
") end if end select Next end if end if %>
<% next %>
<% if len(theDescription) > 0 then theDescription=replace(theDescription,"
","") theDescription=replace(theDescription,chr(34),"'") end if if MediumImage <> "" then%> <% else %> <% end if %>
Title: <%=theTitle%>
Author: <%if theTitle="Per-City Poems" then response.write "Zach Kluckman" else response.write theAuthor end if%>
Price: <% if theTitle="Per-City Poems" then response.write "$7.00 USD" else response.write thePrice & " " & theCurrencyCode end if %>
EAN: <%=theEAN%>
ISBN: <%=theISBN%>
Binding: <%=theBinding%>
Pages: <%=NumPages%>
<% thePublisher=replace(thePublisher,"&","and")%> Publisher: <%=thePublisher%>
<% if thePubDate = "Need" then thePubDate=ReleaseDate if isNull(thePubDate) then thePubDate="Unknown" %> Pub Date: <%=thePubDate%>
<% SalesRnk=0+theSalesRank%> <% if SalesRnk > 0 then %> Amazon Sales Rank: <%=formatNumber(SalesRnk,0) %> <%strSQL="update AmazonSales set sales_rank=" & SalesRnk & " where ASIN='" & theASINs(0,A) & "'" dataConn.execute(strSQL) end if%>

<% if len(BKDesc) > 0 then BKDesc=replace(BkDesc,"
","
") if left(BkDesc,16)="Book Description" then BkDesc="Book Description: " & right(BkDesc,len(BkDesc)-16) else if left(BkDesc,19)="Product Description" then BkDesc="Book Description: " & right(BkDesc,len(BkDesc)-19) end if end if%>

<%=BkDesc%>

Add to Cart
 
zerospacer