Advertisement
Gamebuster

Extreme weather notifier beta v0.0.1.1

Jun 27th, 2015
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. options:
  2. state : NY
  3. county : New York County
  4. #state is the initials of your state
  5. #county is the full name of your county, including the word "county"
  6.  
  7. command /print:
  8. trigger:
  9. $ thread
  10. set {_warning} to text from url "http://www.nws.noaa.gov/view/prodsByState.php?state={@state}&prodtype=warnings##SVRCAE"
  11. set {_comparison} to {_warning}
  12. set {_irreleventText.beginning} to first index of "<pre>" in {_warning}
  13. set {_first} to the first {_irreleventText.beginning} characters of {_warning}
  14. replace all {_first} in {_comparison} with ""
  15. set {_irreleventText.end} to first index of "</pre>" in {_comparison}
  16. set {_comparison} to the first {_irreleventText.end} characters of {_comparison}
  17. replace all {_last} in {_comparison} with ""
  18. if {_comparison} contains "Warning":
  19. if {_comparison} contains "{@county}":
  20. broadcast "<light red>YES"
  21. else:
  22. message "<light green>NO"
  23. else if {_warning} is null:
  24. message "<red>404 Error, check URL."
  25. else:
  26. message "<light green>NO"
  27. #message "%{_comparison}%" to the console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement