anchor.diff:      LBusId = binary_to_list(BusId),
       GetUrl = list_to_binary( ?URL ++ LBusId ),
       erlang:send_after(?FIRST_INTERVAL, self(), check),
  -    {ok, #state{id=BusId, get_url=GetUrl}}.
  +    {ok, #state{id=BusId, get_url=GetUrl, created_at=os:timestamp()}}.
   
   handle_call(_Request, _From, State) ->
       {reply, ignored, State}.
  
positive.code:             {OldListUpdated, [NewData | NewList]}
          end, {OldBusLocationList, []}, BusLocationList),
  
      lager:info("obsoletes: ~p", [Obsoletes]),
      lager:info("new: ~p", [NewBusLocationList]),
  
      case Obsoletes of
          [] -> ok;
          _ ->
              FileName = binary_to_list(BusId) ++ "_" ++ ".txt",
              {ok, IoDevice} = file:open(FileName, [append, {encoding, utf8}]),
              lists:foreach(
                  fun({PlateNo, History}) ->
                          io:format(IoDevice, "{ \"~ts\" : [~p]}", [PlateNo, History])
                  end, Obsoletes),
              ok = file:close(IoDevice)
      end,
  
      erlang:send_after(?INTERVAL, self(), check),
      {noreply, State#state{ bus_location_list=NewBusLocationList} };
  handle_info(_Info, State) ->
      {noreply, State}.
  
  terminate(_Reason, _State) ->
      ok.
  
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  %%%
  
  % 20140818003817
  %date_to_timestamp(DateStr) ->
  %    Year = list_to_integer(binary_to_list(binary:part(DateStr, 0, 4))),
  %    Month = list_to_integer(binary_to_list(binary:part(DateStr, 4, 2))),
  %    Day = list_to_integer(binary_to_list(binary:part(DateStr, 6, 2))),
  %    Hour = list_to_integer(binary_to_list(binary:part(DateStr, 8, 2))),
  %    Minute = list_to_integer(binary_to_list(binary:part(DateStr, 10, 2))),
  %    Second = list_to_integer(binary_to_list(binary:part(DateStr, 12, 2))),
  %
  %    lager:info("~p ~p ~p ~p ~p ~p", [Year, Month, Day, Hour, Minute, Second]).
  
  
negative.code: -record(state, {
            id,
            get_url,
            bus_location_list=[],
            created_at,
            updated_at,
            last_error
           }).
  
  -define(FIRST_INTERVAL, 1000). % TODO: random interval
  %-define(INTERVAL, 30000). % 10 * 1000
  -define(INTERVAL, 60000). % 1 * 60 * 1000
  -define(TIME_DIFF_RETIRE, 86400000). % 86400 * 1000 * 1000
  -define(URL, "http://api.pubtrans.map.naver.com/2.1/live/getBusLocation.jsonp?caller=pc_map&routeId=").
  %-define(URL, "http://localhost").
  
  