80s toys - Atari. I still have
14-08-2016#
admin offline * LeYTi (Sáng Lập!)
Level MAX  Like 0
Xu 0  TN 0
VnMaster

Nay rảnh vọc lại cái trình php cùi bắp của mình .
Đây là mọi đoạn code cho dân gà code muốn làm tool leech đơn giản không dùng curl
Demo : http://khanhsociu.tk
<?php
$url 
$_POST['url']; ///Trang cần leech
Echo 'Lấy nội dung Cap3x.Com';
Echo 
'<form action="?lay" method="post">
        Link truyện<br/>
        <input name="url" type="url" value="http://" focus="focus"/><input type="submit"></form>'
;
$contents file_get_contents($url); // Lấy nội dung link
$title explode('<title>',$contents); //Lấy nội dung từ title đến hết
$title1 explode('</title>',$title[1]); // Lấy mảng thứ 2
$nd explode('<div class="content">',$contents); //Như trên 
$ndr explode('<div class="section-box related-posts">',$nd[1]); //lấy nội dung mảng 
$text $ndr[0]; //lấy mảng đầu tiên
$text str_replace(array('<div align="center"><div class="well info">','<div id="extras">','</p>','<br />','<p class="text-center">','<br>','</div>'),'',$text); //thay thế nội dung
$text str_replace(array('<h2 style="text-align: center;">','<h2>'),'[h2]',$text); // array để lấy nhiều kí tự
$text str_replace(array('<h3>','</h3>','</h2>','<h4>','<strong>','</h4>','</strong>','<br/>','<b class="text-danger">','</b>'),array('[h3]','[/h3]','[/h2]','[h4]','[strong]','[/h4]','[/strong]','[br]','[b]','[/b]'),$text); //array 2 lần để thay thế (ví dụ <h3> => [h3])
$text preg_replace('#<img src="(.*?)" alt="(.*?)" title="(.*?)" onerror="(.*?)" class="(.*?)"/>#is',"[img]$1[/img]",$text); // thay thế kí tự không xác định 
$text preg_replace('#<a href="(.*?)" title="(.*?)" rel="(.*?)">Tải ảnh</a>#is',"",$text);
IF (
$url){
Echo 
'Tiêu đề là : <br/><textarea cols="16" rows="3">'.$title1[0].'</textarea>';
Echo 
'<br/>Nội dung là:<br/><textarea cols="25" rows="30"> '.$text.'</textarea>';
}
Else
{
Echo 
'Lỗi chưa nhập url';
}
?>

Copy code

.
Xong... Đơn cmn giản :oil:
Nguồn: KhanhSociu - 2Hi
Online
» Có 0 thành viên1 khách đang trực tuyến.
Stats
TOP
Facebook - Thanks to XTgem™ Sitemap - Nội quy
© 2015-2017 VnMaster.Yn.Lt
-->