Untitled

From Eratic Matamata, 13 Years ago, written in Plain Text, viewed 2 times.
URL https://paste.blessuren.de/view/2279d53a Embed
Download Paste or View Raw
  1. #!/bin/bash
  2.  
  3. elinks='/usr/local/bin/elinks'
  4.  
  5.  
  6. function getImage()
  7. {
  8.  
  9. echo "checking $1 ..."
  10.  
  11. image=`$elinks -source $1 > out.html && cat out.html | tr ' ' '\n' | grep http://images.4fuckr.com/ | tail -1 | cut
  12.  -d "\"" -f 2`
  13. next=`cat out.html | tr ' ' '\n' | grep 'next' | cut -d "\"" -f 2`
  14.  
  15. echo "$image next: $next"
  16.  
  17. }
  18.  
  19. getImage "$1"
  20.  
  21. while [ $next ]
  22.         do
  23.  
  24.                tmp_image=$image
  25.                getImage "http://www.4fuckr.com$next"
  26.  
  27.         done
  28.  
  29. echo "$tmp_image" > last_image
  30.  

Reply to "Untitled"

Here you can reply to the paste above