ThaiSEOBoard.com

พัฒนาเว็บไซต์ => Programming => ข้อความที่เริ่มโดย: goodwide ที่ 16 กุมภาพันธ์ 2019, 11:12:19



หัวข้อ: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: goodwide ที่ 16 กุมภาพันธ์ 2019, 11:12:19
 :wanwan014:
มาแจก Code fuction [php] scarping ดึง youtube ครับผม


โค๊ด:


<?php 

  ini_set
(&#39;max_execution_time&#39;, 0);
ini_set("memory_limit""1024M");
require_once &#39;lib/simple_html_dom.php&#39;; 
header("Content-Type: text/html; charset=utf-8");


function 
sch_idyoutube($keyword){

$query =   $keyword;
$url = &#39;http://www.google.co.th/search?tbm=vid&source=lnms&tbm=vid&sa=X&q=&#39;.urlencode($query).&#39;&#39;;
$scrape file_get_contents_curl($url);
$doms = new simple_html_dom();
$doms->load($scrape);

                      foreach( 
$doms->find(&#39;div[id=ires]&#39;) as $element){                    
                        
$item[&#39;url&#39;]  =  $element->find(&#39;a&#39;,0)->href ;
                        
$urldata $item;                          
                        }

                       
$xurl =    explode("&"$urldata[&#39;url&#39;]);
                       
$tidyoutube =  substr($xurl[0],-11);
                       return 
$tidyoutube;
                      
}  

?>


ส่วน libraly simple_html_dom ไปโหลดได้ที่
http://simplehtmldom.sourceforge.net/
นะจ๊ะ...

ขอกำลังจัย หน่อย   :-[



หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: phichetkung ที่ 16 กุมภาพันธ์ 2019, 23:13:09
:wanwan014:
มาแจก Code fuction [php] scarping ดึง youtube ครับผม


โค๊ด:


<?php 

  ini_set
(&#39;max_execution_time&#39;, 0);
ini_set("memory_limit""1024M");
require_once &#39;lib/simple_html_dom.php&#39;; 
header("Content-Type: text/html; charset=utf-8");


function 
sch_idyoutube($keyword){

$query =   $keyword;
$url = &#39;[url]http://www.google.co.th/search?tbm=vid&source=lnms&tbm=vid&sa=X&q=&#39;.urlencode([/url]$query).&#39;&#39;;
$scrape file_get_contents_curl($url);
$doms = new simple_html_dom();
$doms->load($scrape);

                      foreach( 
$doms->find(&#39;div[id=ires]&#39;) as $element){                    
                        
$item[&#39;url&#39;]  =  $element->find(&#39;a&#39;,0)->href ;
                        
$urldata $item;                          
                        }

                       
$xurl =    explode("&"$urldata[&#39;url&#39;]);
                       
$tidyoutube =  substr($xurl[0],-11);
                       return 
$tidyoutube;
                      
}  

?>


ส่วน libraly simple_html_dom ไปโหลดได้ที่
[url]http://simplehtmldom.sourceforge.net/[/url]
นะจ๊ะ...

ขอกำลังจัย หน่อย   :-[




เอาไป 10 ดาวครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: !Blogger SEO~~ ที่ 17 กุมภาพันธ์ 2019, 00:52:40
:wanwan014:
มาแจก Code fuction [php] scarping ดึง youtube ครับผม


โค๊ด:


<?php 

  ini_set
(&#39;max_execution_time&#39;, 0);
ini_set("memory_limit""1024M");
require_once &#39;lib/simple_html_dom.php&#39;; 
header("Content-Type: text/html; charset=utf-8");


function 
sch_idyoutube($keyword){

$query =   $keyword;
$url = &#39;[url]http://www.google.co.th/search?tbm=vid&source=lnms&tbm=vid&sa=X&q=&#39;.urlencode([/url]$query).&#39;&#39;;
$scrape file_get_contents_curl($url);
$doms = new simple_html_dom();
$doms->load($scrape);

                      foreach( 
$doms->find(&#39;div[id=ires]&#39;) as $element){                    
                        
$item[&#39;url&#39;]  =  $element->find(&#39;a&#39;,0)->href ;
                        
$urldata $item;                          
                        }

                       
$xurl =    explode("&"$urldata[&#39;url&#39;]);
                       
$tidyoutube =  substr($xurl[0],-11);
                       return 
$tidyoutube;
                      
}  

?>


ส่วน libraly simple_html_dom ไปโหลดได้ที่
[url]http://simplehtmldom.sourceforge.net/[/url]
นะจ๊ะ...

ขอกำลังจัย หน่อย   :-[




56->57

Thank you ครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: HostSevenPlus ที่ 17 กุมภาพันธ์ 2019, 01:42:46
+1 >> 58

 นำใจงามครับ  :wanwan017:


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: del555 ที่ 28 กุมภาพันธ์ 2019, 20:51:37
+1 ครับ  :wanwan017: :wanwan017: :wanwan017:


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: Thairanking ที่ 28 กุมภาพันธ์ 2019, 21:05:21
 :wanwan011: :wanwan011:


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: wookky ที่ 28 กุมภาพันธ์ 2019, 21:15:52
เยี่ยมเลย  :wanwan020:
60


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: cloudsphere ที่ 28 กุมภาพันธ์ 2019, 21:23:13
61 ครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: OptimusPrime ที่ 28 กุมภาพันธ์ 2019, 21:59:52
 :wanwan017: ขอบคุณครับบบ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: hirase8888 ที่ 28 กุมภาพันธ์ 2019, 22:09:49
ขอบคุณครับ 60-61   :wanwan019:

นอกเรื่องนิด  เค้าว่า php จะตายจริงหรือครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: Mrpoohling ที่ 01 มีนาคม 2019, 11:04:35
:wanwan014:
มาแจก Code fuction [php] scarping ดึง youtube ครับผม


โค๊ด:


<?php 

  ini_set
(&#39;max_execution_time&#39;, 0);
ini_set("memory_limit""1024M");
require_once &#39;lib/simple_html_dom.php&#39;; 
header("Content-Type: text/html; charset=utf-8");


function 
sch_idyoutube($keyword){

$query =   $keyword;
$url = &#39;[url]http://www.google.co.th/search?tbm=vid&source=lnms&tbm=vid&sa=X&q=&#39;.urlencode([/url]$query).&#39;&#39;;
$scrape file_get_contents_curl($url);
$doms = new simple_html_dom();
$doms->load($scrape);

                      foreach( 
$doms->find(&#39;div[id=ires]&#39;) as $element){                    
                        
$item[&#39;url&#39;]  =  $element->find(&#39;a&#39;,0)->href ;
                        
$urldata $item;                          
                        }

                       
$xurl =    explode("&"$urldata[&#39;url&#39;]);
                       
$tidyoutube =  substr($xurl[0],-11);
                       return 
$tidyoutube;
                      
}  

?>


ส่วน libraly simple_html_dom ไปโหลดได้ที่
[url]http://simplehtmldom.sourceforge.net/[/url]
นะจ๊ะ...

ขอกำลังจัย หน่อย   :-[




เก็บๆๆ ขอบคุณครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: ppttonline ที่ 01 มีนาคม 2019, 11:36:45
เยี่ยมเลยครับ


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: gsoclub ที่ 01 มีนาคม 2019, 11:45:18
ขอบคุณครับผม  :wanwan020: :wanwan020:


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: khamingroup ที่ 01 มีนาคม 2019, 11:50:13
ขอบคุณครับผม


หัวข้อ: Re: มาแจก Code function [PHP] scarping ดึง ID youtube ครับผม
เริ่มหัวข้อโดย: tarrekup ที่ 01 มีนาคม 2019, 14:22:21
เยี่ยมครับ  :wanwan013: