Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate


Tuesday, September 11th, 2012 at 3:09:12pm UTC 

  1. #!/bin/sh
  2. while [ "$1" ]; do
  3.         [ -r _tmp ] ||
  4.         wget --user-agent="Mozilla/5.0 (X11; Linux x86_64) KHTML/4.8.4 (like Gecko) Konqueror/4.8" \
  5.             -O _tmp"$1"
  6.         echo -n "$1 "
  7.         sed '/.*>Digi-Key Stock: \([0-9,]*\)<.*/s//\1/p;d' _tmp |
  8.             tr -d , | tr '\012' ' '
  9.         sed '/Price Break/,/<.table>/p;d' _tmp |
  10.             sed '/.*>\([0-9,]\+\)<.*>\([0-9,.]\+\)<.*>\([0-9,.]\+\)<.*/s//\1 \2/p;d' |
  11.             tr -d , | tr '\012' ' '
  12.         echo
  13.         shift
  14. done


Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)

Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus