anchor.diff:  -define(MAXBODY, 10000).
   
   init(_Args) ->
  -    spawn_link(?MODULE, status_loop, [undefined, [], fun status_notice/1]),
       {ok, ok}.
   
   
   handle_event(Msg, State) ->
       case Msg of
  +        {in, _IrcBot, [_Server, _Name, <<"JOIN">>, <<"#lugola">>]} ->
  +            spawn(?MODULE, status_loop, [undefined, [], fun status_notice/1]);
           {in, IrcBot, [_Nick, _Name, <<"PRIVMSG">>, Channel = <<"#lugola">>, <<"!status">>]} ->
               doit(IrcBot, Channel);
           {in, IrcBot, [_Nick, _Name, <<"PRIVMSG">>, Channel = <<"#lugola">>, <<"!статус"/utf8>>]} ->
  
positive.code:   hackney:close(Ref),
    case StatusCode of
      200 ->
        {match, [Status]} = re:run(Body, <<"^status: (\\w+)$">>, [caseless, multiline, {newline, anycrlf}, {capture, [1], binary}]),
        Status;
      _ ->
        ErrMsg = list_to_binary(integer_to_list(StatusCode)),
        {error, <<"http:", ErrMsg/binary>>}
  
negative.code:   end).
  
  get_status() ->
      Url = <<"https://hacklab.ie.mk/sub?id=status">>,
      Options = [{recv_timeout, 5000}, {follow_redirect, true}],
      case hackney:request(get, Url, [], <<>>, Options) of
        {ok, StatusCode, _RespHeaders, Ref} ->
  