Strict Standards: Declaration of action_plugin_blog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/blog/action.php on line 13

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/indexmenu/action.php on line 13

Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldchangelog/action.php on line 8

Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldindex/action.php on line 8

Strict Standards: Declaration of action_plugin_include::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/include/action.php on line 19

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 211

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 421

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 594

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/cache.php on line 291

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/auth.php on line 154

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 73
まぐまぐ君 [開発チーム]
<?php
 
define("DOMAIN","http://www.mag2.com");
define("URL_BASE","http://www.mag2.com/j/bsc/%s/%s.html");
define("FILENAME","/home/fideli/suzaki/magmag/log/".date("YmdHis")."_");
 
$parm = getPrm();
 
foreach($parm as $name => $max){
	for($i=1;$i<=$max;$i++){
		$url = sprintf(URL_BASE,$name,str_pad($i,4,"0",STR_PAD_LEFT));
		if(!$listStr = wget($url)){
			continue;
		}
		$reg = "/<!-- MAG-UNIT -->(.+?)<!-- \/MAG-UNIT -->/";
		if(!preg_match_all($reg,$listStr,$match)){
			continue;
		}
		foreach($match[1] as $key => $unit){
			$DATA = array();
			$cateReg = "/<ol class=\"mag-cat clearfix\">(.+?)<\/ol>/";
			if(!preg_match($cateReg,$unit,$cateMatch)){
				continue;
			}
			$cateLinkReg = "/<li><a.+?>(.+?)<\/a><\/li>/";
			if(!preg_match_all($cateLinkReg,$cateMatch[1],$cateLinkMatch)){
				continue;
			}
			$DATA["cate"] = join("||",$cateLinkMatch[1]);
			$titleReg = "/<dt class=\"mag-title\">.+?<a href=\"(.+?)\">(.+?)<\/a>/";
			if(!preg_match($titleReg,$unit,$titleMatch)){
				continue;
			}
			$DATA["title"] = $titleMatch[2];
			$DATA["url"] = DOMAIN.$titleMatch[1];
			$detail = array("meta-id",
							"meta-price",
							"meta-number",
							"meta-update",
							"meta-type",
							"meta-period");
			foreach($detail as $dv){
				$dvReg = "/<li class=\"".$dv."\" title=\".+?\">(.+?)<\/li>/";
				if(!preg_match($dvReg,$unit,$dvMatch)){
					continue;
				}
				$DATA[$dv] = $dvMatch[1];
			}
			$bnReg = "/<li class=\"meta-bn\".+?href=\"(.+?)\".+?<\/li>/";
			if(!preg_match($bnReg,$unit,$dnMatch)){
				continue;
			}
			$DATA["back"] = $dnMatch[1];
			if(!$back = wget($DATA["back"])){
				continue;
			}
			$DATA["site"] = "";
			$siteReg = "/id=\"mag-url\".+?href=\"(.+?)\"/";
			$host = "";
			if(preg_match($siteReg,$back,$siteMatch)){
				$DATA["site"] = $siteMatch[1];
				$parse = parse_url($DATA["site"]);
				$host = $parse["host"];
			}
			$backReg = "/<pre style=\"white-space: -moz-pre-wrap; word-wrap: break-word;\">(.+?)<\/pre>/";
			if(!preg_match($backReg,$back,$backDetail)){
				continue;
			}
			$backDetail[1] = mb_convert_kana($backDetail[1],"a","UTF-8");
			$DATA["mail"] = "";
			$DATA["mailsame"] = "";
			$reg = "/([-_\.a-zA-Z0-9]+\@[-_\.a-zA-Z0-9]+)/";
			if(preg_match($reg,$backDetail[1],$mailMatch)){
				list($ad,$domain) = explode("@",$mailMatch[1]);
				$DATA["mail"] = $mailMatch[1];
				if(strpos($host,$domain) === false){
				}else{
					$DATA["mailsame"] = "同じ";
				}
			}
			$infoReg = "/<p class=\"mag-info\">(.+?)<\/p>/";
			if(!preg_match($infoReg,$unit,$info)){
				continue;
			}
			memo(join("\t",$DATA));
			$DATA["info"] = preg_replace("/<.+?>/"," ",$info[1]);
			error_log(join("\t",$DATA)."\n", 3,FILENAME.$name.".txt");
		}
	}
}
//>>> ・カテゴリ ← 追加しました
//>>> ・メルマガ名
//>>> ・メルマガ説明 ← 追加しました
//>>> ・通数
//>>> ・発行周期
//>>> ・URL ← まぐまぐの詳細URL
//>>> ・発行者サイト ← 取れれば…。
//>>> ・メールアドレス
//<dt class="mag-title">
//<span>
//
//<a href="/m/0000257628.html">レベルアップ!ビジネス成功論</a>
//
//
//</span>
//</dt>
//<li id="mag-url"><a href="http://www.nexyzbb.ne.jp/~kimitoboku/" target="_blank" title="発行者サイト">発行者サイト</a></li>
 
//<dd class="mag-body">
//<ol class="mag-cat clearfix">
//<li><a href="http://www.mag2.com/j/bsc/">ビジネス・キャリア</a></li>
//<li><a href="http://www.mag2.com/j/bsc/mn/0001.html">マナー・一般常識</a></li>
//<li><a href="http://www.mag2.com/j/bsc/mn/99/0001.html">その他</a></li>
//
//</ol>
//
//<p class="mag-info">
//ビジネスで成功をつかむためには、作業の効率化と思考の改革が必要です。あなたをレベルアップさせるノウハウを配信していきます。ビジネスだけではなく、人生における成功への道を一緒に探していきましょう。
//</p>
//
//<ul class="mag-meta clearfix">
//<li class="meta-id" title="メルマガID">0000257628</li>
//<li class="meta-price" title="価格">無料</li>
//<li class="meta-number" title="部数">71部</li>
//<li class="meta-update" title="最新発行日">2009/04/20</li>
//
//<li class="meta-bn" title="バックナンバー"><a href="http://archive.mag2.com/0000257628/index.html" target="_blank">最新号のみ公開</a></li>
//
//<li class="meta-type" title="形式">
//PC・携帯向け/テキスト形式
//</li>
//<li class="meta-period" title="発行周期">不定期</li>
//</ul>
//</dd>
 
function wget($url,$encode = 'SJIS'){
	sleep(1);
	$line = file_get_contents($url);
//	$line = mb_convert_encoding($line,'UTF-8', $encode);
	$line = preg_replace('/(\n|\t|&nbsp;|\r\n)/',' ',$line);
	$line = preg_replace('/\s+/',' ',$line);
	return $line;
}
 
function memo($str){
	print_r($str);
	echo("\n");
}
function getPrm(){
	return array(
					"an" => 39,
					"nb" => 42,
					"mn" => 15,
				);
//	/j/bsc/an/0001.html
//	/j/bsc/nb/0001.html
//	/j/bsc/mn/0001.html
}
まぐまぐ君.txt · 最終更新: 2010/07/27 15:46 (外部編集)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 81