Windows, SysUtils, Classes, ComCtrls, Controls, Forms, IdHTTP,
{HTTPApp,} YofUtils, IdGlobal, IdException, IdComponent, IniFiles, {DateUtils,}
GikoSystem, BoardGroup, ExternalBoardManager, ExternalBoardPlugInMain,
- Sort, SyncObjs;
+ Sort, SyncObjs, bmRegExp;
type
TDownloadItem = class;
lastContent : string;
logFile : TFileStream;
adjustMargin : Integer;
+ Host: String;
+ Sep: Integer;
const
ADJUST_MARGIN = 16;
begin
end;
}
-//////////////// 2013/10/13 ShiroKuma\91Î\89\9e zako Start ///////////////////////////
if (Item.DownType = gdtThread) and (Item.ResponseCode = 302) then begin
{$IFDEF DEBUG}
Writeln('offlaw2.so\82Å\8eæ\93¾');
end;
end;
end;
-//////////////// 2013/10/13 ShiroKuma\91Î\89\9e zako End /////////////////////////////
-//////////////// 2014/03/08 Rokka\91Î\89\9e zako Start ///////////////////////////////
if (Item.DownType = gdtThread) and ((Item.ResponseCode = 302) or (Item.ResponseCode = 404)) then begin
FSessionID := '';
Synchronize(GetSessionID);
end;
end;
end;
-//////////////// 2014/03/08 Rokka\91Î\89\9e zako End /////////////////////////////////
//********************
// 2ch\8aO\95\94\94Â
//********************
- if not GikoSys.Is2chHost(GikoSys.UrlToServer(URL)) then begin
+// if not GikoSys.Is2chHost(GikoSys.UrlToServer(URL)) then begin
+ Host := URL;
+ Sep := Pos('://', Host);
+ if (Sep > 0) then
+ Delete(Host, 1, Sep + 2);
+ Sep := Pos('/', Host);
+ if (Sep > 0) then
+ SetLength(Host, Sep - 1);
+ if not GikoSys.Is2chHost(Host) then begin
if (Item.DownType = gdtThread) and (Item.ResponseCode = 404) then begin
{$IFDEF DEBUG}
Writeln('\8aO\95\94\94Â\89ß\8b\8e\83\8d\83O\8eæ\93¾');
{$ENDIF}
+ ATitle := Item.ThreadItem.Title;
+ if ATitle = '' then
+ ATitle := '\81i\96¼\8fÌ\95s\96¾\81j';
+ FMsg := '\81\9a\82Q\82¿\82á\82ñ\82Ë\82é\8aO\95\94\94Â\82Ì\89ß\8b\8e\83\8d\83O\8eæ\93¾\82ð\8ds\82¢\82Ü\82· - [' + ATitle + ']';
+ FIcon := gmiWhat;
+ if Assigned(OnDownloadMsg) then
+ Synchronize(FireDownloadMsg);
URL := Item.ThreadItem.GetExternalBoardKakoDatURL;
Modified := Item.ThreadItem.LastModified;
RangeStart := 0;
{$ENDIF}
end;
end;
-
+(*
//********************
//offlaw.cgi\82Å\8eæ\93¾
//********************
Synchronize(FireDownloadMsg);
end;
end;
-
+*)
case Item.ResponseCode of
200: Item.State := gdsComplete;
206: Item.State := gdsDiffComplete;
ResRow: Integer;
DTIdx: Integer;
Ok: Boolean;
+ AWKStr: TAWKStr;
+ RStart: Integer;
+ RLength: Integer;
begin
+ AWKStr := TAWKStr.Create(nil);
Ok := False;
ResultDate := Item.LastModified;
ResList := TStringList.Create;
// '2013/04/22(\8c\8e) 02:32:36'
SetLength(LastRes, 23);
Delete(LastRes, 11, 4); // \97j\93ú\8dí\8f\9c
- try
- ResultDate := StrToDateTime(LastRes);
- Ok := True;
- except
+
+ // \93ú\95t\8am\94F
+// AWKStr.RegExp := '(\d{4})/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])';
+ AWKStr.RegExp := '(19|20)([0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])';
+ if (AWKStr.Match(AWKStr.ProcessEscSeq(LastRes), RStart, RLength) = 1) then begin
+
+ AWKStr.RegExp := '([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])';
+ if (AWKStr.Match(AWKStr.ProcessEscSeq(LastRes), RStart, RLength) < 1) then begin
+ SetLength(LastRes, 10);
+ LastRes := LastRes + ' 00:00:00';
+ end;
+
+ try
+ ResultDate := StrToDateTime(LastRes);
+ Ok := True;
+ except
+ end;
end;
if (Ok = True) then
break;
ResList.Free;
end;
Item.LastModified :=ResultDate;
+ FreeAndNil(AWKStr);
end;
end.