Created
August 7, 2013 19:17
-
-
Save sethhall/6177493 to your computer and use it in GitHub Desktop.
Everyone keeps asking about when the videos will be posted, so here's a script that runs in the preview release (git master).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| redef exit_only_after_terminate = T; | |
| module BroExchangeWatch; | |
| export { | |
| redef enum Notice::Type += { | |
| Woo, | |
| }; | |
| } | |
| # We store the current etag here so we can watch for it to change. | |
| global current_etag = ""; | |
| event check_website() | |
| { | |
| when ( local resp = ActiveHTTP::request([$url="http://www.bro.org/community/exchange2013.html"]) ) | |
| { | |
| if ( current_etag == "" ) | |
| current_etag = resp$headers["ETag"]; | |
| if ( current_etag != resp$headers["ETag"] ) | |
| { | |
| print "Bro Exchange 2013 webpage updated!"; | |
| NOTICE([$note=BroExchangeWatch::Woo, | |
| $msg=fmt("Are the videos posted?")]); | |
| } | |
| schedule 5mins { check_website() }; | |
| } | |
| timeout 1min | |
| { | |
| schedule 5mins { check_website() }; | |
| } | |
| } | |
| event bro_init() | |
| { | |
| event check_website(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment