ギコナビ
Revision | d5d9969ea515d270715f5d6d5f8ee0992b638012 (tree) |
---|---|
Time | 2004-10-03 03:37:56 |
Author | cvs2git <cvs2git> |
Commiter | cvs2git |
This commit was manufactured by cvs2svn to create tag 'v1_49_0_548'.
@@ -2911,9 +2911,8 @@ begin | ||
2911 | 2911 | if (PathRec.FNoParam) then begin |
2912 | 2912 | PathRec.FSt := 1; |
2913 | 2913 | PathRec.FTo := 1; |
2914 | - end else begin | |
2914 | + end else | |
2915 | 2915 | Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo); |
2916 | - end; | |
2917 | 2916 | GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark ); |
2918 | 2917 | |
2919 | 2918 | if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin |
@@ -2940,10 +2939,10 @@ begin | ||
2940 | 2939 | // wkIntTo := 1; |
2941 | 2940 | //if PathRec.FFirst then |
2942 | 2941 | // wkIntSt := 1; |
2943 | - //if PathRec.FStBegin then //http://````/-50Æ¢¤Æ« | |
2944 | - // wkIntSt := 1; // | |
2945 | - //if PathRec.FToEnd then //http://````/50-Æ¢¤Æ« | |
2946 | - // wkIntTo := 9999; // Ç¿çÌêàAGetPopupResNumberŤÜÔð²®·éÌÅÓæ¤B | |
2942 | + if PathRec.FStBegin then | |
2943 | + wkIntSt := 1; | |
2944 | + if PathRec.FToEnd then | |
2945 | + wkIntTo := 9999; | |
2947 | 2946 | |
2948 | 2947 | //ATitle := ActiveFileName <> PathRec.FKey; |
2949 | 2948 | if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then |
@@ -3671,7 +3670,7 @@ begin | ||
3671 | 3670 | for i := 0 to BrowserTab.Tabs.Count - 1 do begin |
3672 | 3671 | if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin |
3673 | 3672 | if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin |
3674 | - Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] ); | |
3673 | + Result := TBrowserRecord( BrowserTab.Tabs.Objects[j] ); | |
3675 | 3674 | if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = nil then begin |
3676 | 3675 | for j := BrowserTab.Tabs.Count - 1 downto 0 do begin |
3677 | 3676 | if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
@@ -3859,13 +3858,11 @@ begin | ||
3859 | 3858 | |
3860 | 3859 | |
3861 | 3860 | try |
3862 | - { | |
3863 | 3861 | if ThreadItem.UnRead then begin |
3864 | 3862 | ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; |
3865 | 3863 | if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0; |
3866 | 3864 | TreeView.Refresh; |
3867 | 3865 | end; |
3868 | - } | |
3869 | 3866 | if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin |
3870 | 3867 | if (FActiveContent.Browser <> BrowserNullTab.Browser) then |
3871 | 3868 | ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); |
@@ -4008,16 +4005,12 @@ end; | ||
4008 | 4005 | procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); |
4009 | 4006 | var |
4010 | 4007 | Board: TBoard; |
4011 | - i: Integer; | |
4012 | 4008 | begin |
4013 | 4009 | if ActiveList is TBoard then begin |
4014 | - for i := Length( BBSs ) - 1 downto 0 do begin | |
4015 | - BBSs[i].SelectText := SelectText; | |
4016 | - BBSs[i].KubetsuChk := KubetsuChk; | |
4017 | - end; | |
4018 | 4010 | Board := TBoard(ActiveList); |
4019 | -// Board.ParentCategory.ParenTBBS.SelectText := SelectText; | |
4020 | -// Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk; | |
4011 | + | |
4012 | + Board.ParentCategory.ParenTBBS.SelectText := SelectText; | |
4013 | + Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk; | |
4021 | 4014 | // Board.SelectText := SelectText; |
4022 | 4015 | // Board.KubetsuChk := KubetsuChk; |
4023 | 4016 | ViewType := AViewType; |
@@ -6695,20 +6688,10 @@ begin | ||
6695 | 6688 | threadItem := BrowserRecord.Thread; |
6696 | 6689 | |
6697 | 6690 | if (BrowserRecord <> nil) and (Length( BrowserRecord.Movement ) > 0) then begin |
6698 | - if threadItem.UnRead then begin | |
6699 | - threadItem.UnRead := False; | |
6700 | - threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; | |
6701 | - if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0; | |
6702 | - TreeView.Refresh; | |
6703 | - ListView.Refresh; | |
6704 | - end; | |
6705 | 6691 | BrowserMovement( BrowserRecord.Movement, BrowserRecord ); |
6706 | 6692 | BrowserRecord.Movement := ''; |
6707 | 6693 | end else if threadItem.UnRead then begin |
6708 | 6694 | threadItem.UnRead := False; |
6709 | - threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; | |
6710 | - if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0; | |
6711 | - TreeView.Refresh; | |
6712 | 6695 | BrowserMovement( 'new', BrowserRecord ); |
6713 | 6696 | ListView.Refresh; |
6714 | 6697 | end else if threadItem.ScrollTop <> 0 then begin |
@@ -9010,10 +8993,9 @@ begin | ||
9010 | 8993 | ModifySelectList; |
9011 | 8994 | end else if Length( SelectComboBox.Text ) = 0 then |
9012 | 8995 | begin |
9013 | - {* SelectComboBox.TextªóÅàAüÍrÅEscµ½Æ© | |
9014 | - * óÌÆ«ÉDelL[ðµ½Æ©ÈÌÅAXÌiÝðÛ·éB | |
9015 | - * i±±ÅͽàµÈ¢j | |
9016 | - *} | |
8996 | + AllItemAction.Checked := True; | |
8997 | + LogItemAction.Checked := False; | |
8998 | + NewItemAction.Checked := False; | |
9017 | 8999 | end else begin |
9018 | 9000 | // `Âƾ©çAêµÄ éÆ«¾¯·é |
9019 | 9001 | if AllItemAction.Checked then |
@@ -11165,16 +11147,12 @@ begin | ||
11165 | 11147 | SelectListItem(List); |
11166 | 11148 | for i := 0 to List.Count - 1 do begin |
11167 | 11149 | if TObject(List[i]) is TThreadItem then begin |
11168 | - if (TThreadItem(List[i]).UnRead) then begin | |
11169 | - TThreadItem(List[i]).UnRead := false; | |
11170 | - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1; | |
11171 | - end; | |
11150 | + TThreadItem(List[i]).UnRead := false; | |
11151 | + TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1; | |
11172 | 11152 | end; |
11173 | 11153 | end; |
11174 | 11154 | if TreeView.Visible then |
11175 | 11155 | TreeView.Refresh; |
11176 | - if ListView.Visible then | |
11177 | - ListView.Refresh; | |
11178 | 11156 | finally |
11179 | 11157 | List.Free; |
11180 | 11158 | end; |
@@ -11190,16 +11168,12 @@ begin | ||
11190 | 11168 | SelectListItem(List); |
11191 | 11169 | for i := 0 to List.Count - 1 do begin |
11192 | 11170 | if TObject(List[i]) is TThreadItem then begin |
11193 | - if (TThreadItem(List[i]).IsLogFile) and (not TThreadItem(List[i]).UnRead) then begin | |
11194 | - TThreadItem(List[i]).UnRead := true; | |
11195 | - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1; | |
11196 | - end; | |
11171 | + TThreadItem(List[i]).UnRead := true; | |
11172 | + TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1; | |
11197 | 11173 | end; |
11198 | 11174 | end; |
11199 | 11175 | if TreeView.Visible then |
11200 | 11176 | TreeView.Refresh; |
11201 | - if ListView.Visible then | |
11202 | - ListView.Refresh; | |
11203 | 11177 | finally |
11204 | 11178 | List.Free; |
11205 | 11179 | end; |
@@ -1259,10 +1259,8 @@ begin | ||
1259 | 1259 | OldCnt := Body.IndexOf(oldBody.Strings[ LastIdx ]) + 1; |
1260 | 1260 | until ( OldCnt <> 0 ) or (LastIdx = 0); |
1261 | 1261 | |
1262 | - if OldCnt >= Body.Count then OldCnt := Body.Count - 1; | |
1263 | 1262 | NewRes := Body.Count - OldCnt; |
1264 | 1263 | |
1265 | - | |
1266 | 1264 | finally |
1267 | 1265 | oldBody.Free; |
1268 | 1266 | end; |
@@ -1299,10 +1297,8 @@ begin | ||
1299 | 1297 | ThreadItem.AllResCount := ThreadItem.Count; |
1300 | 1298 | ThreadItem.IsLogFile := True; |
1301 | 1299 | ThreadItem.RoundDate := Now; |
1302 | - if not ThreadItem.UnRead then begin | |
1303 | - ThreadItem.UnRead := True; | |
1304 | - ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead + 1; | |
1305 | - end; | |
1300 | + ThreadItem.UnRead := True; | |
1301 | + ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead + 1; | |
1306 | 1302 | // if ThreadItem.RoundNo = 6 then |
1307 | 1303 | // ThreadItem.RoundNo := 0; |
1308 | 1304 |
@@ -89,7 +89,7 @@ Windows Server 2003 Enterprise Edition IE6 | ||
89 | 89 | ------------------------------ |
90 | 90 | ð |
91 | 91 | ------------------------------ |
92 | -2004/10/XX | |
92 | +2004/XX/XX | |
93 | 93 | Version ÊÞÀ49 |
94 | 94 | ¨CÉüèÌÇÝÝ̬»ÉæéN®ÔÌZk |
95 | 95 | StatusBarÉNG[ht@C̼OªoÈ¢sïÌC³ |
@@ -101,8 +101,6 @@ Windows Server 2003 Enterprise Edition IE6 | ||
101 | 101 | ftHgÅÌXAJ[|bvAbvªííÌ`®ÉÎ |
102 | 102 | R¿áñËéi8¿áñËéjðo^·éÆQ¿áñËé̪\¦³êésïÌðÁ |
103 | 103 | ¨CÉüèÅÒWÉXy[XL[üÍÌsïÌC³ |
104 | - µ½çÎJBBSÌßOÉÖ·ésïÌC³ | |
105 | - XbhÌNÅXÔª éàÌð¥ñ¾Æ«ÉA»ÌXÔÜÅXN[·éæ¤Éµ½B | |
106 | 104 | |
107 | 105 | 2004/09/05 |
108 | 106 | Version ÊÞÀ48 |
@@ -3,7 +3,7 @@ library ShitarabaJBBSPlugIn; | ||
3 | 3 | { |
4 | 4 | ShitarabaJBBSPlugIn |
5 | 5 | µ½çÎjbg |
6 | - $Id: ShitarabaJBBSPlugIn.dpr,v 1.36 2004/09/30 11:49:44 h677 Exp $ | |
6 | + $Id: ShitarabaJBBSPlugIn.dpr,v 1.34 2004/09/29 15:52:15 h677 Exp $ | |
7 | 7 | } |
8 | 8 | |
9 | 9 | uses |
@@ -33,7 +33,7 @@ type | ||
33 | 33 | |
34 | 34 | private |
35 | 35 | function Download : TDownloadState; |
36 | - function StorageDownload(AURL : string) : TDownloadState; | |
36 | + function StorageDownload(Path, Document : string) : TDownloadState; | |
37 | 37 | function Write( inName : string; inMail : string; inMessage : string ) : TDownloadState; |
38 | 38 | function GetRes( inNo : Integer ) : string; |
39 | 39 | function GetDat( inNo : Integer ) : string; |
@@ -505,14 +505,24 @@ begin | ||
505 | 505 | uriList := TStringList.Create; |
506 | 506 | try |
507 | 507 | ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); |
508 | - if uriList[ 5 ] = 'l100' then begin | |
509 | - FileName := uriList[ 4 ] + '.dat'; | |
510 | - FilePath := MyLogFolder + uriList[ 2 ] + '\' + uriList[ 3 ] + '\' + uriList[ 4 ] + '.dat'; | |
511 | - IsLogFile := FileExists( FilePath ); | |
512 | - end else begin | |
513 | - FileName := uriList[ 5 ] + '.dat'; | |
514 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
508 | + if (AnsiPos('.html', uri.Document) = 0) then begin //Êí | |
509 | + if uriList[ 5 ] = 'l100' then begin | |
510 | + FileName := uriList[ 4 ] + '.dat'; | |
511 | + FilePath := MyLogFolder + uriList[ 2 ] + '\' + uriList[ 3 ] + '\' + uriList[ 4 ] + '.dat'; | |
512 | + IsLogFile := FileExists( FilePath ); | |
513 | + end else begin | |
514 | + FileName := uriList[ 5 ] + '.dat'; | |
515 | + FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
516 | + IsLogFile := FileExists( FilePath ); | |
517 | + end; | |
518 | + end else begin //ßO | |
519 | + //http://jbbs.livedoor.com/game/1578/storage/1086710948.html | |
520 | + FileName := Copy(uri.Document, 1, Length(uri.Document) - 5) + '.dat'; | |
521 | + FilePath := MyLogFolder + CustomStringReplace(CustomStringReplace(uri.Path, '/storage', ''), '/', '\') + FileName; | |
515 | 522 | IsLogFile := FileExists( FilePath ); |
523 | + URL := uri.Protocol + '://' + uri.Host + '/bbs/read.cgi' + | |
524 | + CustomStringReplace(uri.Path, '/storage', '') + CustomStringReplace(uri.Document, '.html', '/'); | |
525 | + | |
516 | 526 | end; |
517 | 527 | finally |
518 | 528 | uri.Free; |
@@ -556,102 +566,117 @@ begin | ||
556 | 566 | Result := dsError; |
557 | 567 | |
558 | 568 | uri := TIdURI.Create( ReadURL ); |
559 | - uriList := TStringList.Create; | |
560 | - try | |
561 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
562 | - FileName := uriList[ 5 ] + '.dat'; | |
563 | - // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
564 | - // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
565 | - if MyLogFolder = '' then begin | |
566 | - // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ | |
567 | - FilePath := TemporaryFile; | |
568 | - FIsTemporary := True; | |
569 | - end else begin | |
570 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
571 | - FIsTemporary := False; | |
572 | - end; | |
573 | - finally | |
569 | + if(( AnsiPos('.html', uri.Document) >0 ) and ( AnsiPos('/storage/', uri.Path) > 0 )) then begin | |
570 | + //ऱ±ÉÍüÁıȢ©àB | |
571 | + //ßO | |
572 | + //http://jbbs.shitaraba.jp/bbs/read.cgi/game/3477/1077473358/ | |
573 | + //http://jbbs.shitaraba.jp/game/bbs/read.cgi?BBS=3477&KEY=1077473358 | |
574 | + //http://jbbs.shitaraba.jp/game/3477/storage/1077473358.html | |
575 | + Result := StorageDownload(uri.Path, uri.Document); | |
576 | + URL := uri.Protocol + '://' + uri.Host + '/bbs/read.cgi/' + | |
577 | + CustomStringReplace(uri.Path, '/storage', '') + CustomStringReplace(uri.Document, '.html', '/'); | |
574 | 578 | uri.Free; |
575 | - uriList.Free; | |
576 | - end; | |
577 | 579 | |
578 | - // Û¶pÌfBNgð@é | |
579 | - ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) ); | |
580 | + end else begin | |
581 | + //»Ý¶«ÄéXbh | |
582 | + uriList := TStringList.Create; | |
583 | + try | |
584 | + ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
585 | + FileName := uriList[ 5 ] + '.dat'; | |
586 | + // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
587 | + // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
588 | + if MyLogFolder = '' then begin | |
589 | + // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ | |
590 | + FilePath := TemporaryFile; | |
591 | + FIsTemporary := True; | |
592 | + end else begin | |
593 | + FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
594 | + FIsTemporary := False; | |
595 | + end; | |
596 | + finally | |
597 | + uri.Free; | |
598 | + uriList.Free; | |
599 | + end; | |
580 | 600 | |
581 | - // Æ©É_E[hâtB^OðsíÈ¢êÍ | |
582 | - // InternalDownload ÉC¹é±Æªoé | |
583 | - modified := LastModified; | |
584 | - datURL := ReadURL + IntToStr( Count + 1 ) + '-'; // V ÌÝ | |
585 | - responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
601 | + // Û¶pÌfBNgð@é | |
602 | + ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) ); | |
586 | 603 | |
587 | - try | |
588 | - if (responseCode = 200) or (responseCode = 206) then begin | |
589 | - downResult := TStringList.Create; | |
590 | - try | |
591 | - tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ',' ); | |
592 | - downResult.Text := EUCtoSJIS( tmpText ); | |
593 | - ArrangeDownloadData(Count, downResult); | |
594 | - if downResult.Count > 0 then begin | |
595 | - if FileExists( FilePath ) then | |
596 | - logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ) | |
597 | - else | |
598 | - logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); | |
599 | - try | |
600 | - logStream.Position := logStream.Size; | |
601 | - logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) ); | |
602 | - finally | |
603 | - logStream.Free; | |
604 | - end; | |
604 | + // Æ©É_E[hâtB^OðsíÈ¢êÍ | |
605 | + // InternalDownload ÉC¹é±Æªoé | |
606 | + modified := LastModified; | |
607 | + datURL := ReadURL + IntToStr( Count + 1 ) + '-'; // V ÌÝ | |
608 | + responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
609 | + | |
610 | + try | |
611 | + if (responseCode = 200) or (responseCode = 206) then begin | |
612 | + downResult := TStringList.Create; | |
613 | + try | |
614 | + tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ',' ); | |
615 | + downResult.Text := EUCtoSJIS( tmpText ); | |
616 | + ArrangeDownloadData(Count, downResult); | |
617 | + if downResult.Count > 0 then begin | |
618 | + if FileExists( FilePath ) then | |
619 | + logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ) | |
620 | + else | |
621 | + logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); | |
622 | + try | |
623 | + logStream.Position := logStream.Size; | |
624 | + logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) ); | |
625 | + finally | |
626 | + logStream.Free; | |
627 | + end; | |
605 | 628 | |
606 | - if Count = 0 then | |
607 | - // VK | |
608 | - Result := dsComplete | |
609 | - else | |
610 | - // ÇL | |
611 | - Result := dsDiffComplete; | |
629 | + if Count = 0 then | |
630 | + // VK | |
631 | + Result := dsComplete | |
632 | + else | |
633 | + // ÇL | |
634 | + Result := dsDiffComplete; | |
612 | 635 | |
613 | - Size := Size + Length( downResult.Text ); | |
614 | - // CGI ©çͳµ¢útª¾çêÈ¢ÌÅ»ÝÉÝè | |
615 | - LastModified := Now; | |
636 | + Size := Size + Length( downResult.Text ); | |
637 | + // CGI ©çͳµ¢útª¾çêÈ¢ÌÅ»ÝÉÝè | |
638 | + LastModified := Now; | |
616 | 639 | |
617 | 640 | |
618 | 641 | |
619 | - NewReceive := Count + 1; | |
620 | - Count := Count + downResult.Count; | |
621 | - NewResCount := downResult.Count; | |
642 | + NewReceive := Count + 1; | |
643 | + Count := Count + downResult.Count; | |
644 | + NewResCount := downResult.Count; | |
622 | 645 | |
623 | 646 | |
624 | 647 | |
625 | - end else begin | |
626 | - Result := dsNotModify; | |
648 | + end else begin | |
649 | + Result := dsNotModify; | |
650 | + end; | |
651 | + finally | |
652 | + downResult.Free; | |
627 | 653 | end; |
628 | - finally | |
629 | - downResult.Free; | |
630 | - end; | |
631 | - end else if responseCode = 302 then begin | |
632 | - //http://jbbs.shitaraba.com/bbs/read.cgi/game/3477/1077473358/ | |
633 | - //http://jbbs.shitaraba.com/game/bbs/read.cgi?BBS=3477&KEY=1077473358 | |
634 | - //http://jbbs.shitaraba.com/game/3477/storage/1077473358.html | |
635 | - //ßO | |
636 | - //tmpURL := URL; | |
637 | - if Assigned( InternalPrint ) then | |
638 | - InternalPrint( 'ßOqÉüè' ); | |
639 | - uri := TIdURI.Create( ReadURL ); | |
640 | - uriList := TStringList.Create; | |
641 | - try | |
642 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
643 | - tmpURL := uri.Protocol + '://' + uri.Host + | |
644 | - '/' + uriList[3] + '/' + uriList[4] + '/storage/' + uriList[ 5 ] + '.html'; | |
645 | - finally | |
646 | - uriList.Free; | |
654 | + end else if responseCode = 302 then begin | |
655 | + //http://jbbs.shitaraba.com/bbs/read.cgi/game/3477/1077473358/ | |
656 | + //http://jbbs.shitaraba.com/game/bbs/read.cgi?BBS=3477&KEY=1077473358 | |
657 | + //http://jbbs.shitaraba.com/game/3477/storage/1077473358.html | |
658 | + //ßO | |
659 | + tmpURL := URL; | |
660 | + uri := TIdURI.Create( ReadURL ); | |
661 | + uriList := TStringList.Create; | |
662 | + try | |
663 | + ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
664 | + URL := uri.Protocol + '://' + uri.Host + | |
665 | + '/' + uriList[3] + '/' + uriList[4] + '/storage/' + uriList[ 5 ] + '.html'; | |
666 | + finally | |
667 | + uriList.Free; | |
668 | + uri.Free; | |
669 | + end; | |
670 | + uri := TIdURI.Create( ReadURL ); | |
671 | + Result := StorageDownload(uri.Path, uri.Document); | |
647 | 672 | uri.Free; |
673 | + URL := tmpURL; | |
674 | + end else if responseCode = 304 then begin | |
675 | + Result := dsNotModify; | |
648 | 676 | end; |
649 | - Result := StorageDownload(tmpURL); | |
650 | - end else if responseCode = 304 then begin | |
651 | - Result := dsNotModify; | |
677 | + finally | |
678 | + DisposeResultString( tmp ); | |
652 | 679 | end; |
653 | - finally | |
654 | - DisposeResultString( tmp ); | |
655 | 680 | end; |
656 | 681 | |
657 | 682 | end; |
@@ -691,16 +716,17 @@ end; | ||
691 | 716 | // ßOpDownloadÖ |
692 | 717 | // ************************************************************************* |
693 | 718 | function TShitarabaThreadItem.StorageDownload( |
694 | - AURL : string | |
719 | + Path, Document : string | |
695 | 720 | ) : TDownloadState; |
696 | 721 | var |
697 | 722 | modified : Double; |
698 | 723 | tmp : PChar; |
699 | - uri : TIdURI; | |
700 | - uriList : TStringList; | |
701 | 724 | downResult : TStringList; |
702 | 725 | responseCode : Longint; |
703 | 726 | logStream : TFileStream; |
727 | + //uri : TIdURI; | |
728 | + //uriList : TStringList; | |
729 | + datURL : string; | |
704 | 730 | tmpText, tmpLine, tmpTitle: string; |
705 | 731 | tmpHTML: TStringList; |
706 | 732 |
@@ -709,24 +735,23 @@ var | ||
709 | 735 | begin |
710 | 736 | |
711 | 737 | Result := dsError; |
712 | - uri := TIdURI.Create( ReadURL ); | |
713 | - uriList := TStringList.Create; | |
738 | + | |
739 | + //uri := TIdURI.Create( ReadURL ); | |
714 | 740 | try |
715 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
716 | - FileName := uriList[ 5 ] + '.dat'; | |
717 | - // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
718 | - // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
741 | + FileName := Copy(Document, 1, Length(Document) - 5) + '.dat'; | |
719 | 742 | if MyLogFolder = '' then begin |
720 | 743 | // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ |
721 | 744 | FilePath := TemporaryFile; |
722 | 745 | FIsTemporary := True; |
723 | 746 | end else begin |
724 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
747 | + FilePath := MyLogFolder | |
748 | + + CustomStringReplace(CustomStringReplace(Path, '/storage', ''), '/', '\') | |
749 | + + FileName; | |
750 | + | |
725 | 751 | FIsTemporary := False; |
726 | 752 | end; |
727 | 753 | finally |
728 | - uri.Free; | |
729 | - uriList.Free; | |
754 | + //uri.Free; | |
730 | 755 | end; |
731 | 756 | |
732 | 757 | // Û¶pÌfBNgð@é |
@@ -738,7 +763,8 @@ begin | ||
738 | 763 | // InternalDownload ÉC¹é±Æªoé |
739 | 764 | modified := LastModified; |
740 | 765 | |
741 | - responseCode := InternalDownload( PChar( AURL ), modified, tmp, 0 ); | |
766 | + datURL := ReadURL; | |
767 | + responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
742 | 768 | |
743 | 769 | try |
744 | 770 | if (responseCode = 200) or (responseCode = 206) then begin |
@@ -1163,12 +1189,19 @@ begin | ||
1163 | 1189 | if (tmphost = BBS_HOST_OLD) or (tmphost = BBS_HOST_OLD2) then |
1164 | 1190 | tmphost := BBS_HOST; |
1165 | 1191 | |
1166 | - FileName := uriList[ 5 ] + '.dat'; | |
1167 | - // http://jbbs.livedoor.com/bbs/read.cgi/computer/351/1090404452/l100 | |
1168 | - // http://jbbs.livedoor.com/bbs/read.cgi/game/1578/1067968274/l100 | |
1169 | - // http://jbbs.livedoor.com/game/1000/subject.txt | |
1170 | - Result := CreateResultString( | |
1171 | - uri.Protocol + '://' + tmphost + '/' + uriList[ 3 ] + '/' + uriList[ 4 ] + '/' ); | |
1192 | + if( AnsiPos('.html', uri.Document) = 0 ) then begin //Êí | |
1193 | + FileName := uriList[ 5 ] + '.dat'; | |
1194 | + // http://jbbs.livedoor.com/bbs/read.cgi/computer/351/1090404452/l100 | |
1195 | + // http://jbbs.livedoor.com/bbs/read.cgi/game/1578/1067968274/l100 | |
1196 | + // http://jbbs.livedoor.com/game/1000/subject.txt | |
1197 | + Result := CreateResultString( | |
1198 | + uri.Protocol + '://' + tmphost + '/' + uriList[ 3 ] + '/' + uriList[ 4 ] + '/' ); | |
1199 | + end else begin | |
1200 | + //http://jbbs.livedoor.com/game/1578/storage/1086710948.html | |
1201 | + Result := CreateResultString( | |
1202 | + uri.Protocol + '://' + tmphost + CustomStringReplace(uri.Path, '/storage', '')); | |
1203 | + end; | |
1204 | + | |
1172 | 1205 | finally |
1173 | 1206 | uri.Free; |
1174 | 1207 | uriList.Free; |
@@ -1265,8 +1298,7 @@ begin | ||
1265 | 1298 | end else if AnsiPos(THREAD_MARK, URL) = 0 then begin |
1266 | 1299 | //RRÅßO©Ç¤©`FbNH |
1267 | 1300 | if(AnsiPos('.html/', uri.Path) > 0) then begin |
1268 | - Result := uri.Protocol + '://' + tmphost + THREAD_MARK + | |
1269 | - CustomStringReplace(CustomStringReplace(uri.Path, '/storage', ''), '.html/', '/') + 'l100'; | |
1301 | + Result := uri.Protocol + '://' + tmphost + Copy(uri.Path, 1, Length(uri.Path) - 1); | |
1270 | 1302 | end else |
1271 | 1303 | Result := URL; |
1272 | 1304 | end; |
@@ -1334,6 +1366,12 @@ begin | ||
1334 | 1366 | Result := |
1335 | 1367 | uri.Protocol + '://' + tmphost + '/bbs/rawmode.cgi/' + |
1336 | 1368 | uriList[ 3 ] + '/' + uriList[ 4 ] + '/' + uriList[ 5 ] + '/'; |
1369 | + end else if AnsiPos(THREAD_MARK, URL) = 0 then begin | |
1370 | + //RRÅßO©Ç¤©`FbNH | |
1371 | + if(AnsiPos('.html/', uri.Path) > 0) then begin | |
1372 | + Result := uri.Protocol + '://' + tmphost + Copy(uri.Path, 1, Length(uri.Path) - 1); | |
1373 | + end else | |
1374 | + Result := URL; | |
1337 | 1375 | end; |
1338 | 1376 | finally |
1339 | 1377 | uri.Free; |