- 论坛徽章:
- 27
|
5> count:init().
<0.62.0>
(4)(0)(1)(3)(0)(0)(0)(1)(1)(0)(1)(0)(0)(0)(0)(0)(0)
(C)......................... (Erlang)
(4)(0)(1)(3)(0)(0)(0)(1)(1)(0)(1)(0)(0)(0)(0)(0)(0)
(C)......................... (Erlang)
(4)(0)(1)(3)(0)(0)(0)(1)(1)(0)(1)(0)(0)(0)(0)(0)(0)- -module(count).
- -compile(export_all).
- init()->
- spawn(count,delay,[]).
- delay()->
- receive
- _ ->
- void
- after 3000 ->
- try s()
- catch
- _:_ -> io:format("detected error, reboot process~n"),
- s()
- end
-
- end,
- delay().
- s()->
- inets:start(),
- {ok,{{_,200,_},_,Body}}=httpc:request(get,{"http://bbs.chinaunix.net/forum.php?gid=60",[]},[],[]),
- %io:format([Body]).
- {match,A}=re:run(Body,"<td class=\"bold subject\" align=\"left\" colspan=3>\r\n\.*\r\n\t\r\n(.*)\r",[global,{capture,all_but_first,list}]),
- io:format([A]),
- io:format("~n(C)......................... (Erlang) ~n").
-
复制代码 |
|