Extract Buyee package information to a table

Drag this link to Favourites Bar.

Buyee Package Extract

Note: If you have more than a page of packages (20) there seems to be a Buyee bug where it does not load the dimensions for the extra packages. Therefore you need to change the display order and then deal with any duplicates, if you have more than 40 packages then I think you're stuck.

Here is the nicer formatted source code:

javascript:(function(){
var table = [
  "<table id='gunzel'>",
    "<thead>",
      "<tr>",
        "<th>Id</th>",
        "<th>Days</th>",
        "<th>Weight</th>",
        "<th>Length</th>",
        "<th>Width</th>",
        "<th>Height</th>",
        "<th>Description</th>",
      "</tr>",
    "</thead>",
    "<tbody>"
];
$("li.luggageInfo").each(function(index) {
  var id = $(this).attr('id');
  var weight = $(this).find('div.delivery_info_container > div.invoice_info > dl > dd:nth-child(6)').text().trim().replace(',', '').replace("g", "");
  var dimensions = $(this).find('div.delivery_info_container > div.invoice_info > dl > dd:nth-child(8)').text().replace("cm", "").replace(" ", "").trim();
  var a = dimensions.split("×"), depth = a[0], width = a[1], height = a[2];
  depth = depth ? depth.trim() : '';
  width = width ? width.trim() : '';
  height = height ? height.trim() : '';
  var description = $(this).find('div.luggageInfo_container > div.luggageInfo_order_wrap.default_order_wrap > table > tbody > tr:nth-child(2) > td:nth-child(3)').html().trim();
  var days = $(this).find('span.storage-remaining-days').text().trim();
  table.push(
      "<tr>",
        "<td>" + id + "</td>",
        "<td>" + days + "</td>",
        "<td>" + weight + "</td>",
        "<td>" + depth + "</td>",
        "<td>" + width + "</td>",
        "<td>" + height + "</td>",
        "<td>" + description + "</td>",
      "</tr>"
  );
});
table.push(
    "</tbody>",
  "</table>",
  "<style type='text/css'>",
    "#gunzel th, #gunzel td { padding: 0 5px 0 5px; }",
    "#gunzel td { text-align: right; }",
    "#gunzel > tbody > tr > td:nth-child(7) { text-align: left; }",
  "</style>"
);
$('h1.content_tit').after(table.join("\n"));
})();