#!/bin/bash standard2g=$(wget https://www.dragonbox.de/en/354-pyra-preorder-standard-edition-2gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) standard4g=$(wget https://www.dragonbox.de/en/415-pyra-preorder-standard-edition-4gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) mobile2gus=$(wget https://www.dragonbox.de/en/353-pyra-preorder-mobile-ed-us-2gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) mobile2geu=$(wget https://www.dragonbox.de/en/355-pyra-preorder-mobile-ed-eu-vers-2gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) mobile4gus=$(wget https://www.dragonbox.de/en/414-pyra-preorder-mobile-ed-us-ver-4gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) mobile4geu=$(wget https://www.dragonbox.de/en/416-pyra-preorder-mobile-ed-eu-vers-4gb-ram-pyra.html -O - 2>/dev/null | grep quantityAvailable | grep var | awk '{ print $4 }' | sed 's/;//' | awk '{ print "2000 - "$1 }' | bc) mobiletotal=$(echo $mobile2gus + $mobile2geu + $mobile4gus + $mobile4geu | bc) mobiletotal2g=$(echo $mobile2gus + $mobile2geu | bc) mobiletotal4g=$(echo $mobile4gus + $mobile4geu | bc) total4g=$(echo $standard4g + $mobile4gus + $mobile4geu | bc) total2g=$(echo $standard2g + $mobile2gus + $mobile2geu | bc) total=$(echo $total2g + $total4g | bc) totalstandard=$(echo $standard2g + $standard4g | bc) percentmobile=$(($mobiletotal * 100 / $total)) percentmobile2g=$(($mobiletotal2g * 100 / $total)) percentmobile4g=$(($mobiletotal4g * 100 / $total)) percentstandard4g=$(($standard4g * 100 / $total)) percentstandard2g=$(($standard2g * 100 / $total)) percentstandard=$(($totalstandard * 100 / $total)) percent4g=$(($total4g * 100 / $total)) percent2g=$(($total2g * 100 / $total)) percent1000=$(($total * 100 / 750)) moneymobile2g=$(($mobiletotal2g * 400)) moneymobile4g=$(($mobiletotal4g * 400)) moneystandard2g=$(($total2g * 330)) moneystandard4g=$(($total4g * 330)) totalmoney=$(echo $moneymobile2g + $moneymobile4g + $moneystandard2g + $moneystandard4g | bc) #echo "Pyra Preorders: (Standard Editions: 2GB $standard2g '${percent2g}%' & 4GB $standard4g '${percent4g}%') (Mobile Edition: US2GB $mobile2gus + EUR2GB $mobile2geu '${percentmobile2g}%' & US4GB $mobile4gus + EUR4GB $mobile4geu '${percentmobile4g}%')" > /mnt/rd/fanbot/pyra-preorders #echo "Stats: $total Total Units. ${percent1000}% of 1000 units. Pledges: ME2G €${moneymobile2g} / ME4G €${moneymobile2g} / SE2G €${moneystandard2g} / SE4G €${moneystandard4g} with Total Pledges: €${totalmoney}" > /mnt/rd/fanbot/pyra-preorders echo "Total preorders: $total [${mobiletotal} mobile (${percentmobile}%); ${total2g}x 2GB (${percent2g}%), ${total4g}x 4GB (${percent4g}%)] {Stand2GB: $standard2g, Stand4GB: $standard4g, US2GB: $mobile2gus, US4GB: $mobile4gus, EU2GB: $mobile2geu, EU4GB: $mobile4geu} @ `date '+%F %T %Z'` - http://p.rdw.se/pyra-preorder.html" > /mnt/rd/fanbot/pyra-preorders echo "Total preorders: $total [$mobiletotal networked; $total2g 2GB, $total4g 4GB] {Stand2GB: $standard2g, Stand4GB: $standard4g, US2GB: $mobile2gus, US4GB: $mobile4gus, EU2GB: $mobile2geu, EU4GB: $mobile4geu} @ `date '+%F %T %Z'`" >> /mnt/rd/steven/preorder_stats/preorder_stats cd /mnt/rd/steven/preorder_stats ./clean-output.sh < preorder_stats > cleaned_output.txt gnuplot plot.preorders cp preorders.svg /mnt/rd/steven/rdw/i cat > /mnt/rd/steven/rdw/p/pyra-preorder.html < Pyra Handheld

$total Sold!

We're ${percent1000}% on the way to the 750 unit milestone required for minimal order!

Standard Editions [${percentstandard}% Popularity]:

${standard2g} x 2GB

${standard4g} x 4GB

Mobile Edition [${percentmobile}% Popularity]:

${mobile2gus} x 2GB-USA

${mobile2geu} x 2GB-EUR

${mobile4gus} x 4GB-USA

${mobile4geu} x 4GB-EUR

Bootstrap Image Preview

Last page update: `date '+%F %T %Z'`

DELIM