마음 속 하늘은 항상 맑음~!

txtworker 업데이트. 본문

프로그래밍

txtworker 업데이트.

파르셀수스 2014. 12. 27. 13:23

루아로 간단한 문자열 관련 작업을 위한 유틸리티 txtworker의 업데이트.

쓰는 사람은 별로 없겠지만 =ㅅ=;


https의 웹 내용을 가져오는 기능을 추가하고, 그리드의 셀추가 기능의 업데이트 빈도를 단축하고, CSV의 읽기 기능을 표준화(RFC)된 라이브러리 강화 등등.


그 외에는 크게 변한 것은 없다.


https의 연결은 주소 머리에 "https://"를 넣어줘야 제대로 동작한다.



다음은 실시간 이슈를 가져오는 예제.

Grid_Clear();
txt=GetHttpText('http://www.daum.net');
if not txt then
write('error')
end;
reg=RegEx_New('(?i)<span(\\s+)?class=\"txt_issue\">(\\s+)?<a href=\"[^\"]+\" class=\"[^\"]+\">(\\s+)?(\\S+)');
res=RegEx_MatchAll(reg,txt);
xmax=res['Col'];
ymax=res['Row'];
for i=0,ymax do
for j=0,xmax do
  key=res[tostring(i)..','..tostring(j)];
  if key then
    Grid_Value(j,i,key);
  else
    break
  end;
end;
end;
RegEx_Delete(reg);       


정규식 결과를 CSV로 저장하는 함수 기능의 추가.

정규식 결과를 보다 단순하게 결과를 가져와서 확인이 가능해짐.


Grid_Clear();
txt=GetHttpText('http://www.daum.net');
if not txt then
write('error')
end;
reg=RegEx_New('(?i)<span(\\s+)?class=\"txt_issue\">(\\s+)?<a href=\"[^\"]+\" class=\"[^\"]+\">(\\s+)?(\\S+)');
res=RegEx_MatchAllCSV(reg,txt);
Grid_LoadStr(res)
RegEx_Delete(reg);    



txtworker_r21.zip


'프로그래밍' 카테고리의 다른 글

avast와 gdb와 w10.  (0) 2016.03.30
간단한 파일 웹서버 업데이트.  (0) 2015.02.28
minisheet 업데이트.  (0) 2014.12.09
웹파일 서버 업데이트.  (0) 2014.05.29
간단한 스프레드시트.  (0) 2013.12.26