<s> import requests <EOL> from will . plugin import WillPlugin <EOL> from will . decorators import respond_to , periodic , hear , randomly , route , rendered_template , require_settings <EOL> class HipChatIsUpPlugin ( WillPlugin ) : <EOL> @ periodic ( second = '<STR_LIT>' ) <EOL> def hipchat_is_up ( self ) : <EOL> try : <EOL> r = requests . get ( "<STR_LIT>" ) <EOL> last_status = self . load ( "<STR_LIT>" ) <EOL> if r . json ( ) [ "<STR_LIT:status>" ] [ "<STR_LIT>" ] != last_status : <EOL> if r . json ( ) [ "<STR_LIT:status>" ] [ "<STR_LIT>" ] != "<STR_LIT:none>" : <EOL> self . say ( "<STR_LIT>" % r . json ( ) [ "<STR_LIT:status>" ] [ "<STR_LIT:description>" ] ) <EOL> else : <EOL> self . say ( "<STR_LIT>" ) <EOL> self . save ( "<STR_LIT>" , r . json ( ) [ "<STR_LIT:status>" ] [ "<STR_LIT>" ] ) <EOL> except : <EOL> pass </s>
