mikespook

懒猫开始新生活——猫眼看世界
本人乃好事之徒,找骂者请自便
PS:如果哪天我不跟坎子找茬了,那我就是死了。^_^
随笔 - 121, 文章 - 0, 评论 - 545, 引用 - 5
数据加载中……

2005年8月26日

本以为GOOGLE会用XML来存放聊天记录

没想到,虽然是XML的思维方式,但是根本不是XML。解析部分还在修改,呵呵~~

<?
require_once(
'File/Find.php');

class XYGoogleTalkLog
{
  var $files;
  var $path;
  
  function XYGoogleTalkLog($path)
  
{
    $
this->path = $path;
    $
this->files = File_Find::mapTreemultiple($this->path);
  }

  
  function show()
  
{
    header(
'Content-type: text/html; charset=utf-8');
    
foreach($this->files as $file)
    
{
      echo $
this->decoder($this->path."/".$file);
    }

  }

  
  function decoder($file)
  
{
    $contents 
= file_get_contents($file);
    
return urldecode($contents);
  }

}


if (isset($_SERVER['argv']['path']))
{
  $path 
= $_SERVER['argv']['path'];
}

elseif (isset($_GET[
'path']))
{
  $path 
= $_GET['path'];
}

else
{
  echo 
"Pleas give the parameter path as your Google Talk Log directory.";
  exit;
}


$google 
= new XYGoogleTalkLog($path);
$google
->show();
?>

posted @ 2005-08-26 09:52 mikespook 阅读(376) | 评论 (1)编辑