SHOW:
|
|
- or go back to the newest paste.
| 1 | <base target="read"> | |
| 2 | <?php | |
| 3 | require_once('htmlparser.inc');
| |
| 4 | ||
| 5 | $WORD = rawurlencode($_GET['res']); | |
| 6 | - | print "検索語句:".rawurldecode($WORD)."<br>"; |
| 6 | + | print "検索語句:".rawurldecode($WORD)."<br><br>"; |
| 7 | ||
| 8 | - | $URL = ("https://find.2ch.net/?COUNT=30&STR=" ."$WORD");
|
| 8 | + | $parser = HtmlParser_ForURL("http://ff2ch.syoboi.jp/?q=" ."$WORD");
|
| 9 | - | $htmlText = @file_get_contents( "$URL" ); |
| 9 | + | |
| 10 | - | $parser = new HtmlParser ($htmlText); |
| 10 | + | |
| 11 | {
| |
| 12 | if($parser->iNodeAttributes['class'] == "board") | |
| 13 | {$board = "<a href=".$parser->iNodeAttributes['href'].">".$parser->iNodeValue."</a><br>";}
| |
| 14 | - | $value = $parser->iNodeValue; |
| 14 | + | |
| 15 | - | if($parser->iNodeName = "a" && str_replace("test/read","",$parser->iNodeAttributes['href']) != $parser->iNodeAttributes['href'] && $parser->iNodeValue)
|
| 15 | + | if(strpos($parser->iNodeAttributes['href'], "read") == true) |
| 16 | - | print "<a href=http://localhost/rep2/read.php?&url=".$parser->iNodeAttributes['href'].">$value</a><br>"; |
| 16 | + | {$thread = "<a href=http://192.168.0.1/rep2/read.php?&url=".$parser->iNodeAttributes['href'].">$parser->iNodeValue</a><br>";}
|
| 17 | ||
| 18 | if($parser->iNodeAttributes['class'] == "time") | |
| 19 | {$time = $parser->iNodeValue;}
| |
| 20 | ||
| 21 | print $board.$time.$thread; | |
| 22 | ||
| 23 | $thread =""; | |
| 24 | $time =""; | |
| 25 | $board =""; | |
| 26 | } | |
| 27 | ?> |