Difference between revisions of "Adafruit Order"

From ATXHackerspace

Jump to: navigation, search
(May 2013 Adafruit Order is CLOSED)
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
 
If there are any major items that are marked <font color='red'>OUT OF STOCK</font> the order will not be placed until either 1) the rest of the order totals more than $250 or 2) the major items come back into stock .. usually 5-7 days.
 
If there are any major items that are marked <font color='red'>OUT OF STOCK</font> the order will not be placed until either 1) the rest of the order totals more than $250 or 2) the major items come back into stock .. usually 5-7 days.
  
== May 2013 Adafruit Order is CLOSED ==
+
== September 2013 Adafruit Order is OPEN ==
  
 
{| border="2" align="center" id="orderTable"
 
{| border="2" align="center" id="orderTable"
Line 20: Line 20:
 
! scope="col" | MEMBER
 
! scope="col" | MEMBER
 
|-
 
|-
|1278
+
|9999
|[http://www.adafruit.com/products/1278 BeagleBone Black]
+
|[http://www.adafruit.com/products/9999 Example Item]
|2
+
|1
|$45.00
+
|$1.00
|$45.00
+
|$1.00
|$90.00
+
|$1.00
|Martin Bogomolni
 
|-
 
|954
 
|[http://www.adafruit.com/products/954 USB to TTL serial Cable]
 
|2
 
|$9.95
 
|$7.00
 
|$14.00
 
|Martin Bogomolni
 
|-
 
|276
 
|[http://www.adafruit.com/products/276 5V, 2A Power Supply]
 
|2
 
|$9.95
 
|$7.00
 
|$14.00
 
 
|Martin Bogomolni
 
|Martin Bogomolni
|-
 
|1278
 
|[http://www.adafruit.com/products/1278 BeagleBone Black]
 
|1
 
|$45.00
 
|$45.00
 
|$45.00
 
|Jessica Ross
 
|-
 
|954
 
|[http://www.adafruit.com/products/954 USB to TTL serial Cable]
 
|1
 
|$9.95
 
|$7.00
 
|$7.00
 
|Jessica Ross
 
|-
 
|1278
 
|[http://www.adafruit.com/products/1278 BeagleBone Black]
 
|1
 
|$45.00
 
|$45.00
 
|$45.00
 
|Eric Blount
 
|-
 
|1278
 
|[http://www.adafruit.com/products/1278 BeagleBone Black]
 
|1
 
|$45.00
 
|$45.00
 
|$45.00
 
|Vlad
 
|-
 
|249
 
|[http://www.adafruit.com/products/249 Light and temperature data-logger pack]
 
|1
 
|$37.50
 
|$26.25
 
|$26.25
 
|Eric Blount
 
|-
 
|1278
 
|[http://www.adafruit.com/products/1278 BeagleBone Black]
 
|1
 
|$45.00
 
|$45.00
 
|$45.00
 
|Danny Miller
 
|-
 
|&nbsp;
 
|&nbsp;
 
|&nbsp;
 
|&nbsp;
 
|&nbsp;
 
|'''$331.25'''
 
|&nbsp;
 
 
|-
 
|-
 
|SHIPPING
 
|SHIPPING
 
|UPS 2nd Day
 
|UPS 2nd Day
 
|&nbsp;
 
|&nbsp;
|$22.33
+
|$??.??
 
|&nbsp;
 
|&nbsp;
|'''$353.58'''
+
|'''$??.??'''
 
|&nbsp;
 
|&nbsp;
 
|}
 
|}
Line 115: Line 43:
 
</div>
 
</div>
  
<div style="width: 500px; text-align: center; border: 1px solid black;margin: 0 auto;background-image: -moz-linear-gradient(#ddd, #fff);background-image: -webkit-linear-gradient(#ddd, #fff);"><div class="CHANGE_WIDTH_HERE" style="width: 500px;background-color: green; color: white; font-weight: bold;background-image: -moz-linear-gradient(#5b5, #272);background-image: -webkit-linear-gradient(#5b5, #272);">133% of $250 goal</div></div>
+
<div style="width: 500px; text-align: center; border: 1px solid black;margin: 0 auto;background-image: -moz-linear-gradient(#ddd, #fff);background-image: -webkit-linear-gradient(#ddd, #fff);"><div class="CHANGE_WIDTH_HERE" style="width: 0px;background-color: green; color: white; font-weight: bold;background-image: -moz-linear-gradient(#5b5, #272);background-image: -webkit-linear-gradient(#5b5, #272);">0% of $250 goal</div></div>
  
 
== Adding it up ==
 
== Adding it up ==

Latest revision as of 20:16, 28 August 2013

Adafruit Wholesale Order

We get various discounts from Adafruit if we order $250 worth of stuff. It's the Adafruit wholesale discount! So, if you want to get in on an order, add your request to this page. When the total gets to be ~$250, the order goes in, and is delivered to the hackerspace.

There have been various non-paying people on the last couple orders. SO, in order to put the order in this time, when the order is complete we'll be taking the payments BEFORE placing the order. Sorry, but the hackerspace just can't absorb $70-100 in unpaid items.

If there are any major items that are marked OUT OF STOCK the order will not be placed until either 1) the rest of the order totals more than $250 or 2) the major items come back into stock .. usually 5-7 days.

September 2013 Adafruit Order is OPEN

ITEM# DESCRIPTION QTY COST DISCOUNT_COST TOTAL MEMBER
9999 Example Item 1 $1.00 $1.00 $1.00 Martin Bogomolni
SHIPPING UPS 2nd Day   $??.??   $??.??  


0% of $250 goal

Adding it up

Mostly you can add it up your total in your head or with a calculator just as quickly as copy/pasting this, but you can also use some tools to help.

Copy/paste + awk

Copy/paste the table from your web browser into a text file. You should get tab delimited output (tested using Google Chrome pasting into vim). Save the text file as "order.tsv" and run:

 awk -F"\t" '/YOURNAMEHERE/ {print $6}' order.tsv | tr -d '~$ '| awk '{sum+=$1}END{print sum}'

screen scraping with lynx and grep

This avoids the copy/paste, but requires that your name not appear on any other lines in this page.

  lynx -width=500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'

Here's one for elinks, which uses a vertical pipe and variable whitespace when rendering table cells:

  elinks --dump-width 500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+\|[ ]*YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'

Built-in browser javascript console sniffing via DOM

You can open a javsacript console in Google Chrome or Firefox with Firebug installed by pressing the F12 key. Then paste in:

  var NAME_REGEXP=/YOURNAMEHERE/;var t = document.getElementById("orderTable");var sum=0;for( var i =0; i < t.rows.length ; ++i){var r = t.rows[i]; if( NAME_REGEXP.test(r.cells[6].textContent) ) { sum+= parseFloat( r.cells[5].textContent.replace(/[^\d\.]/g,'' ), 10); } };console.log( NAME_REGEXP.source + " owes: $" + sum );

Floating point rounding errors can happen due to IEEE 754 float representation in javscript. You'd have to convert dollars to cents to fix.