Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For screen scraping, the compact layout style might be helpful: <a href="http://bililite.com/blog/2010/10/31/hacking-my-way-to-an-amazon-wishlist-widget/" rel="noreferrer">http://bililite.com/blog/2010/10/31/hacking-my-way-to-an-amazon-wishlist-widget/</a></p> <p><strong>Update</strong></p> <p>I did some hacking of my own in google spreadsheets and managed to get 2 basic implementations working. </p> <p><strong>Using Google Apps Scripts:</strong></p> <p>Type your wishlist ID into cell A1. Copy and paste the following into a google apps script (Tools > Scripts > Scripts Editor), and run the getWishlist function:</p> <pre><code>function getWishlist(){ var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; var wishlistId = sheet.getRange('a1').getValue(); var response = UrlFetchApp.fetch("http://www.amazon.co.uk/registry/wishlist/" + wishlistId + "?layout=compact").getContentText(); var asinRegex = /name="item.([\d]+)\.(?:[A-Z0-9]+).([A-Z0-9]+).*/g while (match = asinRegex.exec(response)) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; var rowIndex = Number(match[1])+2; var asin = match[2]; setRow(sheet, rowIndex, asin); var offers = UrlFetchApp.fetch("http://www.amazon.co.uk/gp/offer-listing/" + asin).getContentText(); setRow(sheet, rowIndex, asin, getFirstMatch(/class="producttitle"&gt;(.+)&lt;/g, offers), getFirstMatch(/class="price"&gt;(.+)&lt;/g, offers)); } Browser.msgBox("Finished"); } function getFirstMatch(regex, text) { var match = regex.exec(text); return (match == null) ? "Unknown" : match[1]; } function setRow(sheet, index, a, b, c) { sheet.getRange('a' + index).setValue(a); sheet.getRange('b' + index).setValue(b); sheet.getRange('c' + index).setValue(c); } </code></pre> <p>​ ​ NB, I'm having some probs with regex matching the title / price. Not sure why, but shows the basic idea.</p> <p><strong>Using Google Spreadsheet Functions</strong></p> <p>Type your wishlist ID into cell A1.</p> <p>Type the following function into A2. It will populate the cell and all below it with the id strings for each item in your wishlist:</p> <pre><code>=importXML("http://www.amazon.co.uk/registry/wishlist/"&amp;A1&amp;"?layout=compact", "//*[starts-with(@name, 'item.')]/@name") </code></pre> <p>Type the following function into B2, which will extract the asin from the id string:</p> <pre><code>=right(A2, 10) </code></pre> <p>Type the following function into B3, which will fetch the offer listing for the asin in B2 and display the title:</p> <pre><code>=importXML("http://www.amazon.co.uk/gp/offer-listing/"&amp;B2, "//h1") </code></pre> <p>Type the following function into B4, which will fetch the offer listing for the asin in B2 and display all the prices:</p> <pre><code>=concatenate(importXML("http://www.amazon.co.uk/gp/offer-listing/"&amp;B2, "//span[@class='price']")) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload