Created
July 7, 2012 18:10
-
-
Save meganechan/3067489 to your computer and use it in GitHub Desktop.
Get Manga
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="form1" method="post" action=""> | |
<label for="link"></label> | |
ใส่ลิงค์ไฟล์ | |
<input type="text" name="link" id="link"> | |
<input type="submit" name="button" id="button" value="Submit"> | |
</form> | |
<? | |
set_time_limit(5000000); | |
function getLinks($link){ | |
global $i; | |
$ret = array(); | |
$dom = new domDocument; | |
@$dom->loadHTML(file_get_contents($link)); | |
$dom->preserveWhiteSpace = false; | |
$links = $dom->getElementsByTagName('script'); | |
foreach ($links as $tag){ | |
$ret= $tag->childNodes->item(0)->nodeValue; | |
} | |
return $ret; | |
} | |
if (isset($_POST['link'])){ | |
$test=getLinks($_POST['link']); | |
$arr = explode ( '"', $test ); | |
$num=count($arr); | |
if (!file_exists($arr[1])) { | |
mkdir($arr[1]); | |
} | |
$a=0; | |
for ($i=0;$i<$num;$i++){ | |
if ( ereg ( "([0-9]+(\.[0-9]+){3})", $arr[$i]) ){ | |
$url=$arr[$i]; | |
} | |
if ( ereg ( "jpg$|png$", $arr[$i],$type) ){ | |
$file[$a]=$arr[$i]; | |
$a++; | |
} | |
// | |
} | |
} | |
for ($i=0;$i<$num;$i++){ | |
copy($url.$file[$i],"./".$arr[1]."/".$i.".".$type[0]); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="form1" method="post" action=""> | |
<input type="text" name="link" id="link"> | |
<input type="submit" name="button" id="button" value="Submit"> | |
</form> | |
<? | |
set_time_limit(5000000); | |
$cap=0; | |
function getLinks($link,$tag_){ | |
global $i,$cap; | |
$ret = array(); | |
$dom = new domDocument; | |
@$dom->loadHTML(file_get_contents($link)); | |
$dom->preserveWhiteSpace = false; | |
$links = $dom->getElementsByTagName($tag_); | |
foreach ($links as $tag){ | |
$ret= $tag->childNodes->item(0)->nodeValue; | |
if ($tag->nodeValue=="Read"){ | |
$cap++; | |
} | |
} | |
return $ret; | |
} | |
if (isset($_POST['link'])){ | |
$test=getLinks($_POST['link'],'a'); | |
$main_url=$_POST['link']; | |
$story_name = explode ( '/', $main_url ); | |
$story_name=$story_name[5]; | |
@mkdir($story_name); | |
for ($c=0;$c<$cap;$c++){ | |
$a=0; | |
@mkdir("./".$story_name."/".($c+1).""); | |
$test=getLinks($main_url."/".($c+1),'script'); | |
$arr = explode ( '"', $test ); | |
$num=count($arr); | |
for ($i=0;$i<$num;$i++){ | |
if ( ereg ( "([0-9]+(\.[0-9]+){3})", $arr[$i]) ){ | |
$url=$arr[$i]; | |
} | |
if ( ereg ( "jpg$|png$", $arr[$i],$type) ){ | |
$file[$a]=$arr[$i]; | |
$a++; | |
} | |
} | |
for ($i=0;$i<$a;$i++){ | |
@copy($url.$file[$i],"./".$arr[1]."/".($c+1)."/".$i.".".$type[0]); | |
} | |
} | |
}//จบif | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment