joeywidget.php.svn-base

来自「j2me is based on j2mepolish, client & se」· SVN-BASE 代码 · 共 56 行

SVN-BASE
56
字号
<?phpclass joeywidget {  var $preview_url;  var $content_url;  var $content;  var $preview;  function load($url)  {    $this->preview_url = null;    $this->content_url = null;    $widget_content = $this->fetch($url);    $do = preg_match("/preview_url:[ \t]*(.*)/", $widget_content, $matches);    if ($do == true) {        $this->preview_url = $matches['1'];    }    $do = preg_match("/content_url:[ \t]*(.*)/", $widget_content, $matches);    if ($do == true) {        $this->content_url = $matches['1'];    }    // go fetch the preview    $this->preview = $this->fetch($this->preview_url);    // go fetch the content    $this->content = $this->fetch($this->content_url);      }  // curl utility function  function fetch($url) {    $ch = curl_init();    curl_setopt ($ch, CURLOPT_USERAGENT, "MobiViewer 1.0");    curl_setopt($ch, CURLOPT_URL,$url); // set url to post to    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Charset:utf-8'));     curl_setopt($ch, CURLOPT_TIMEOUT, 5);    $result = curl_exec($ch);    if (curl_errno($ch)) {      return false;    }    curl_close($ch);        return $result;  }}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?