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

Stuff
Monday, December 24th, 2007 at 4:20:43pm MST 

  1. #!/bin/bash
  2.  
  3. #Sources
  4. WBNG='http://**.**.***.**/*****/closings/sch.html'
  5. LOCAL='/home/User/sch.html'
  6. MSTR_SOURCE="$LOCAL"
  7. DUMP='/home/User/closings_dump'
  8. #End Sources
  9.  
  10. #Create a dumpfile
  11.         w3m -dump $MSTR_SOURCE > $DUMP
  12.  
  13. #Find a One Hour Delay
  14. function check_one
  15. {
  16.         if [ "$( grep -i "School Name" $DUMP )" = " School Name School District    One Hour Delay" ] ;then
  17.                 if [ "$(date +%H%M)" = "0545" ] ;then
  18.                         sleep 1h
  19.                         rm $DUMP
  20.                         check_one
  21.                 fi
  22.                 if [ "$(date +%H%M)" = "0645" ] ;then
  23.                         start_day
  24.                 else
  25.                         check_two
  26.                 fi
  27.  
  28.         fi
  29. }
  30.  
  31. #End One Hour Delay
  32.  
  33. #Find a Two Hour Delay
  34. function check_two
  35. {
  36.         if [ "$( grep -i "School Name" $DUMP )" = " School Name School District    Two Hour Delay" ] ;then
  37.                 if [ "$(date +%H%M)" = "0545" ] ;then
  38.                         sleep 2h
  39.                         rm $DUMP
  40.                         check_one
  41.                 fi
  42.                 if [ "$(date +%H%M)" = "0745" ] ;then
  43.                 start_day
  44.         else
  45.                 check_close
  46.         fi
  47. }
  48. #End Two Hour Delay
  49.  
  50. #Find a Cancellation
  51. function check_close
  52. {
  53.         if [ "$( grep -i "School Name" $DUMP )" = " School Name School District    Closed" ] ;then
  54.                 rm $DUMP
  55.                 exit 0
  56.         else
  57.                 start_day
  58.         fi
  59. }
  60. #End Cancellation
  61.  
  62. #No Delay
  63. function start_day
  64. {
  65.         ####START MORNING#####
  66.         #Turn monitors & music on (norm 5:45am)
  67.                 xset dpms force on
  68.                 amarokapp --play
  69.         #Open today's weather page
  70.                 firefox "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=*****"
  71.         #Send a TXT to 1st person
  72.                 #dcopref=`dcop kmail KMailIface openComposer "address" "" ""  "subject" "message" false`
  73.                 #dcop "$dcopref" send 1
  74.         #These next few lines need to run at 6:20am
  75.                 #dcopref=`dcop kmail KMailIface openComposer "address" "" ""  "subject" "message" false`
  76.                 #dcop "$dcopref" send 1
  77.         #This runs at 7:00am Turn monitors & music off
  78.                 #amarokapp --stop
  79.                 #xset dpms force off
  80.         #Clean up
  81.                 rm $DUMP
  82.                 exit 0
  83. }
  84.  
  85. #Begin Delay Checking
  86.         check_one

advertising

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 expire by default in one month. 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.

worth-right
worth-right