OSDN Git Service

したらばJBBSの板検索のHTMLが変わっていたので対応した。
authorh677 <h677>
Sun, 3 Aug 2008 02:45:48 +0000 (02:45 +0000)
committerh677 <h677>
Sun, 3 Aug 2008 02:45:48 +0000 (02:45 +0000)
res/ExternalBoardPlugIn/ShitarabaJBBSAcquireBoard.pas
res/ExternalBoardPlugIn/ShitarabaJBBSPlugIn.dpr
res/ExternalBoardPlugIn/ShitarabaJBBSPlugIn.res

index b367a86..df0b17c 100644 (file)
@@ -201,6 +201,9 @@ var
        key                                                     : string;
        htmlList                                        : TStringList;
        i                                                       : Integer;
+
+    resultArea                  : Boolean;
+    pos                         : Integer;
 const
     //http://rentalbbs.livedoor.com/jbbs/search/?word=%C2%E7%B3%D8&category=auto
        BBS_HOST                                = 'http://rentalbbs.livedoor.com/';
@@ -212,7 +215,7 @@ const
 label
        NextBoard;
 begin
-
+    responseCode := 0;
        category := CATEGORIES[ CategoryComboBox.ItemIndex ];
        boardname := BoardNameEdit.Text;
 
@@ -237,31 +240,30 @@ begin
                                htmlList := TStringList.Create();
                                try
                                        htmlList.Text   := CustomStringReplace(downResult, '<br>', #13#10);
-                                       for i := htmlList.Count - 1 downto 0 do begin
+                    resultArea := False;
+                                       for i := 0 to htmlList.Count - 1 do begin
                                                downResult := htmlList[i];
                                                try
-                                                       //<a href="/auto/2348/">\83g\83\88\83^\8e©\93®\8eÔ\8cf\8e¦\94Â</a>
-                            //<small><strng><a href="http://jbbs.livedoor.jp/auto/4112/">\96¾\8e¡\91å\8aw\81@\93ñ\95\94\81E\92Z\91å</a></strong></small></td>
-                            if (AnsiPos('<small><strng><a href="', downResult) > 0)
-                                and (AnsiPos(category, downResult) > 0) then begin
-                                downResult := CustomStringReplace(downResult, '<small><strng>', '');
-                                                               board   := Copy(downResult, AnsiPos('<a href="', downResult) + 9,
-                                                                                       Length(downResult));
-                                                               key             := Copy(board, AnsiPos('">', board) + 2,
-                                                                                       Length(board));
-                                                               key             := Copy(key, 1, AnsiPos('</a>', key) -1);
-
-                                                               board   := Copy(board, 1, AnsiPos('">', board) - 1);
-                                                               if (board = '../') then begin
-                                                                       board := CustomStringReplace(board, '../', BOARD_HOST);
-                                                               end else if (AnsiPos('/', board) = 1) then begin
-                                                                       board := BOARD_HOST + Copy(board, 2, Length(board));
-                                                               end;
-
-                                                               board   := key + '=' + board;
-
-                                                               LogEdit.SelText := board + #13#10;
-                                                               FBoardList.Add( board );
+                            //<div class="searchResults">
+                            //<h2><span class="ranking">[1]</span><a href="http://jbbs.livedoor.jp/auto/5497/">MIT-MCC BBS</a><span class="point"><span class="all">4750pt</span><span class="yesterday">(Yesterday40 pt)</span></span></h2>
+                            //<p>\95\90\91 \8dH\8bÆ\91å\8aw\81@\83\82\81[\83^\83T\83C\83N\83\8b\95\94\82ÌBBS\82Å\82·\81B\8ae\8e©\83`\83F\83b\83N\82·\82é\82æ\82¤\82É\82µ\82Ü\82µ\82å\82¤\81ô(&amp;gt;_&amp;lt;)b</p>
+                            //</div>
+                            if (not resultArea) and (AnsiPos('class="searchResults"', downResult) > 0) then begin
+                                resultArea := True;
+                            end else if (resultArea) then begin
+                                pos := AnsiPos('<a href="', downResult);
+                                if (pos > 0) then begin
+                                    resultArea := False;
+                                    downResult := Copy(downResult, pos + 9, Length(downResult));
+                                    key := Copy(downResult, 1, AnsiPos('"', downResult)-1);
+                                    downResult := Copy(downResult, AnsiPos('>', downResult) + 1, Length(downResult));
+
+                                    board        := Copy(downResult, 1, AnsiPos('</a>', downResult) -1);
+
+                                    board      :=  CustomStringReplace(board, '=', '\81\81') + '=' + key;
+                                    LogEdit.SelText := board + #13#10;
+                                    FBoardList.Add( board );
+                                end;
                                                        end;
                                                except
                                                end;
index 3532d2a..17f3350 100644 (file)
@@ -2,7 +2,7 @@ library ShitarabaJBBSPlugIn;
 
 {
        ShitarabaJBBSPlugIn
-       $Id: ShitarabaJBBSPlugIn.dpr,v 1.44 2006/07/02 09:48:04 h677 Exp $
+       $Id: ShitarabaJBBSPlugIn.dpr,v 1.45 2008/08/03 02:45:48 h677 Exp $
 }
 
 uses
@@ -83,7 +83,7 @@ const
        MAJOR_VERSION                   = 1;
        MINOR_VERSION                   = 1;
        RELEASE_VERSION         = 'alpha';
-       REVISION_VERSION        = 15;
+       REVISION_VERSION        = 17;
 
        SYNCRONIZE_MENU_CAPTION = '\82µ\82½\82ç\82ÎJBBS\94Â\8dX\90V';
 
index dd8b1d5..cd1d69b 100644 (file)
Binary files a/res/ExternalBoardPlugIn/ShitarabaJBBSPlugIn.res and b/res/ExternalBoardPlugIn/ShitarabaJBBSPlugIn.res differ