daily pastebin goal
10%
SHARE
TWEET

SL train/Sub script Version 1.1

TheHotBot Apr 4th, 2013 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NOTE
  2. #
  3. # This script is made by me (TheHotBot)
  4. # Use it however you want.
  5. # It is not finished yet!
  6. #
  7. # ALSO!
  8. # You will need "Links" and "toilet" to get this to work
  9. #
  10.  
  11.  
  12. Version 1.1
  13.  
  14. #!/bin/bash
  15. while clear; do
  16.  
  17. toilet -f mono9 --metal SL Sub
  18.  
  19. date
  20.  
  21. echo "--------------------------"
  22.  
  23. OUT1=`links -dump -codepage iso-8859-1 "http://mobilrt.sl.se/?tt=METRO&ls=&SiteId=9302&name=S2lzdGEgY2VudHJ1bSAoU3RvY2tob2xtKQ%3d%3d"|tail -n +8|egrep -ve 'IMG|s.kning|2011|Kontakt|Start|mobil|Realtidsinformation|G*ller endast buss|Upp$|*kning|Du har valt'`
  24.  
  25.   echo "$OUT1" | perl -ne '
  26. if (/((?:.+)\s+)(\d+)(\s+min.*)$/) {
  27.  %ctable = (
  28.    map(($_ => "1;31"), 1..3),
  29.    map(($_ => 31),     4..7),
  30.    map(($_ => 33),     8..10),
  31.    map(($_ => 32),     11..15),
  32.  );
  33.  
  34.  $ctime = $ctable{$2} || 34;
  35.  
  36.  print "$1\033[${ctime}m$2$3\033[m\n";
  37. }
  38. else {
  39.  print;
  40. }
  41. '
  42.  
  43. echo "--------------------------"
  44.  
  45. sleep 30
  46. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top