Phoenix Network FCMS Content Management system Get.php crawl frame, analysis and processing of web content and related substitution Std.php Universal Regular news_67_com.php to Http://news.67.com's crawl analyzer Catch the list first, then grab the content page. Also lack of monitoring, statistics, error handling functions. Personally think it is more fun.
- Include_once dirname (__file__). '/std.php ';
- $site = Array (
- ' Aname ' = ' China Entertainment Network ',
- ' Domain ' = ' news.67.com ',
- ' dirname ' \ = ' directory name, used to match the text based on different directories ',
- ' GetType ' = ' default ',
- Get Master File
- ' Creg ' = '/(SI) (. *?) \<\!--article end-->/',
- ' Code ' = ' Utf-8 ',
- ' Sub ' = ' Get subdirectory regular ',
- ' Content ' = ' tag1 ',
- ' img_upload ' = = Array (' tag1 ' = ') ',
- Next page
- ' Reg_next '/' = '/(? is) next page \>\><\/a>/',
- ' Key0 ' = '/' (? is)/',
- ' Key0_ap ' = = Array (array (', ', ' | '), "),
- ' tag0 ' = '/(? is)
([^<^>]*?) <\/h1>/',
- ' Tag0_arp ' = Array (
- Array
- '/(? is) \ (Photos \)/',
- '/(? is) \ (Figure \)/',
- '/(? is) \ (Figure \.\./',
- '/(? is) \ (Photos \.\./',
- '/(? is) \./',
- '/(? is) ("|")/',
- ),
- Array
- '', '', '', '', '', '',
- )
- ),
- ' Tag1 ' = '/(? is) (. *?) /',
- ' TAG1_BRP ' = Array (
- Array
- '/(? is) (. *?)/',
- '/(? is) \ (. *?\)/',
- '/(? is) \s*
.*? (.*?) <\/p>\s*/',
- '/(? is) \s*
\s*/',
- '/(? is) \s*
\s*/',
- '/(? is)/',
- '/(? is)
/',
- '/(? is) \s*
\s*/',
- '/(? is) \s*
\s*/',
- '/(? is) \s* \s*/',
- '/(? is) \s*<\/center>\s*/',
- '/(? is) \s*
\s*/',
- ),
- Array
- '', '', '
', ' ', ' ', '', '', ' ', ' ', ' ', ' ', ''
- ),
- ),
- ' Tag1_arp ' = Array (
- Array
- '/(? is)
<\/p>/',
- '/(? is)<\/strong>/'
- ),
- Array
- '', ''
- ),
- ),
- ' Strip ' = = Array (' tag1 ' = ') ',
- ' Tag2 ' + '/(? is) Guide: \s* (. *?) \s*<\/div>/',
- ' Tag2_arp ' = Array (
- Array
- '/(? is)/'
- ),
- Array
- ''
- ),
- ),
- ' Tag3 ' + '/(? is) (China Entertainment Network)/',
- ' Tag4 ' = '/(? is) Date: (\d+-\d+-\d+ \d+:\d+:\d+). *?<\/div>/',
- );
- $map = Array (
- ' Tag ' = ' key0 ',
- ' Title ' = ' tag0 ',
- ' Content ' = ' tag1 ',
- ' Summary ' = ' Tag2 ',
- ' Source ' = ' tag3 ',
- ' Pub_date ' = ' tag4 ',
- );
- $site _list = Array (
- ' Aname ' = ' China Entertainment Network ',
- ' Domain ' = ' www.67.com ',
- ' GetType ' = ' default ',
- ' Creg ' = '/(SI) (. *?) /',
- ' Code ' = ' GBK ',
- ' Reg_next ' = '/' (? si)
- Next page <\/a><\/li>/',
- Link
- ' tag0 ' = '/(? is). *? [^<^>]*?<\/a>.*?<\/div>/',
- Title
- ' Tag1 ' = '/(? is). *? ([^<^>]*?) <\/a>.*?<\/div>/',
- ' Tag1_arp ' = Array (
- Array
- '/(? is) \ (Photos \)/',
- '/(? is) \ (Figure \)/',
- '/(? is) \ (Figure \.\./',
- '/(? is) \ (Photos \.\./',
- '/(? is) \./',
- '/(? is) ("|")/',
- ),
- Array
- '', '', '', '', '', '',
- )
- ),
- );
- $list _map = Array (
- ' url ' = ' tag0 ',
- ' Title ' = ' Tag1 ',
- );
- $site _list_sub = Array ();
Copy Code
- Global $STD;
- $STD = Array (
- ' url ' = ' [0-9a-za-z\.\:\-\/%_#;&]+ ',
- ' img ' = '/' (? is)/',
- );
Copy Code
- /**
- * test.php
- *
- * @author xzfred
- * @copyright fengone.com
- * @created 2010-12-07.
- * @version $Id: php.php 3 2008-10-10 07:49:21z Fred $
- * Svnpath $HeadURL: http://192.168.0.16/svn/vim/skeletons/php.php $
- */
- /*
- Include_once "std.php";
- Include_once "lady_163_com.php";
- */
- Include_once $GLOBALS [' G_dir_core ']. "Get.php";
- //================================================================================
- Include_once Dir_host_tag. '/tuku_ent_china_com.php ';
- $obj = new Fchtmlparse ($site);
- $c = $obj->parse (file_get_contents ("Http://tuku.ent.china.com/fun/html/2011-08-23/181703.xml"));
- echo "\n\n\n ===================\n";
- echo $c [' field '] [' tag1 '][0];
- echo "\n\n\n ===================\n";
- Var_dump ($c);
- Exit ();
- List test
- $obj = new Fchtmlparse ($site _list);
- $c = $obj->parse (file_get_contents ("http://tuku.ent.china.com/fun/html/3569_1.html"));
- Var_dump ($c);
- Exit ();
- /*
- $obj = new Fchtmlget ($site);
- $c = $obj->getpage (' http://star.pclady.com.cn/entertainment/ss/1106/703240.html ');
- Var_dump ($c);
- $obj = new Fchtmlget ($site);
- $c = $obj->getpage (' http://star.pclady.com.cn/entertainment/ss/1106/703240.html ');
- Var_dump ($c);
- $obj = new Fchtmlparse ($site);
- $img _obj = new Fchtmlimgupload ($site);
- $data = file_get_contents ("e:/b.html");
- $c = $obj->parse ($data);
- $ic = $img _obj->upload ($c [' tag '] [' Tag1 '][0]);
- Var_dump ($ic);
- $data = file_get_contents ("e:/a.html");
- $c = $obj->parse ($data);
- $ic = $img _obj->upload ($c [' tag '] [' Tag1 '][0]);
- Var_dump ($ic);
- */
- Var_dump ($c [' tag '] [' tag1 ']);
Copy Code
- Include_once $GLOBALS [' G_dir_core ']. ' host/std.php ';
- $site = Array (
- ' Aname ' and ' China Network Entertainment Gallery ',
- ' Domain ' = ' tuku.ent.china.com ',
- ' dirname ' \ = ' directory name, used to match the text based on different directories ',
- ' GetType ' = ' default ',
- Get Master File
- ' Creg ' = '/(SI) ( .*?<\/list>)/',
- ' Code ' = ' Utf-8 ',
- ' Sub ' = ' Get subdirectory regular ',
- ' Content ' = ' tag1 ',
- ' img_upload ' = = Array (' tag1 ' = ') ',
- Next page
- ' Reg_next '/' = '/(? is) next page <\/a>/',
- ' Key0 ' = '/' (? is)/',
- ' Key0_ap ' = = Array (array (', ', ' | '), "),
- ' tag0 ' = '/(? is) title= "([^"]*?) " /',
- ' Tag0_arp ' = Array (
- Array
- '/(? is) \ (Figure \)/',
- '/(? is) \ "/',
- '/(? is) Exclusive:/',
- '/(? is) Exclusive:/',
- '/(? is) ("|")/',
- ),
- Array
- '', '', '', '', '',
- )
- ),
- ' Tag1 ' = '/(? is) (. *?) <\/list>/',
- ' TAG1_BRP ' = Array (
- Array
- '/(? is) \s*\s*/'
- ),
- Array
- '
$
$ '
- )
- ),
- ' Tag1_arp ' = Array (
- Array
- '/(? is)
([^<^>]*?) <\/p>/',
- '/(? is) \<br\/\>/',
- ),
- Array
- '
$ ',
- '',
- )
- ),
- ' Strip ' = = Array (' tag1 ' = ') ',
- Network Name
- ' Tag3 ' = '/(? is)([^<^>]*?) <\/span>/',
- ' Tag4 ' + '/(? is) (China net)/'
- );
- $map = Array (
- ' Tag ' = ' key0 ',
- ' Title ' = ' tag0 ',
- ' Content ' = ' tag1 ',
- ' Author ' = ' Tag3 ',
- ' Source ' = ' tag4 '
- );
- $site _list = Array (
- ' Aname ' and ' China Network Entertainment Gallery ',
- ' Domain ' = ' tuku.ent.china.com ',
- ' GetType ' = ' default ',
- ' Creg ' = '/(SI) (. *?) <\/div>/',
- ' Code ' = ' Utf-8 ',
- ' Reg_next ' = '/' (? si)
- Next page <\/a><\/li>/',
- Link
- ' tag0 ' = '/(? is). *?<\/span>[^<^>]*?<\/a><\/div>/',
- ' TAG0_BRP ' = Array (
- Array
- '/(? is) \.htm/',
- ),
- Array
- '. Xml '
- )
- ),
- Title
- ' Tag1 ' = '/(? is).*?<\/span> ([^<^>]*?) <\/a><\/div>/',
- ' Tag1_arp ' = Array (
- Array
- '/(? is) \ (Figure \)/',
- '/(? is) \ "/',
- '/(? is) Exclusive:/',
- '/(? is) Exclusive:/',
- '/(? is) ("|")/',
- ),
- Array
- '', '', '', '', '',
- )
- ),
- );
- $list _map = Array (
- ' url ' = ' tag0 ',
- ' Title ' = ' Tag1 ',
- );
- $site _list_sub = Array ();
Copy Code |