summaryrefslogtreecommitdiff
path: root/newegg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'newegg.sh')
-rwxr-xr-xnewegg.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/newegg.sh b/newegg.sh
new file mode 100755
index 0000000..235000f
--- /dev/null
+++ b/newegg.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+sed -n \
+ -e 's/.*<a href="\(.*\)" title="View Details">/URL\t\1/p' \
+ -e 's/.*<span class="itemDescription">\(.*\)<\/span>/Desc\t\1/p' \
+ -e 's/.*<li class="priceFinal">\(.*\)<\/li>/Price\t\1/p' \
+ -e 's/.*<li class="priceShip">\(.*\)Shipping<\/li>/Ship\t\1/p' | \
+sed \
+ -e 's/<\/*[a-z]*>//g' \
+ -e 's/&#40;/(/g' \
+ -e 's/&#41;/)/g' \
+ -e 's/&#47;/\//g' \
+ -e 's/Ship\tFree/Ship\t$0.00/' > newegg.$$.out
+grep '^URL' newegg.$$.out | cut -f2 >newegg.$$.url
+grep '^Desc' newegg.$$.out | cut -f2 >newegg.$$.desc
+grep '^Price' newegg.$$.out | cut -f2 >newegg.$$.pri
+grep '^Ship' newegg.$$.out | cut -f2 >newegg.$$.ship
+paste newegg.$$.{url,desc,pri,ship}
+