PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Eugene Panin   Meta tags fetcher   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Usage exmpale
Class: Meta tags fetcher
Fetches meta tag values from a given Web page
Author: By
Last change:
Date: 19 years ago
Size: 885 bytes


Class file image Download
   * Example of META-tags fetching with mtfetcher classes
require_once 'mtfetcher/mtfetcher_Fetcher.php';

$f = new mtfetcher_Fetcher;

// Selecting transport

//$trName = 'fgc'; // Fetch using 'file_get_contents' PHP-function
//$trName = 'file'; // Fetch using 'file' PHP-function. Simplest way to run.
$trName = 'PEAR_Request'; // Fetch using PEAR::HTTP_Request class
$trConf = array(); // Configuration of transport. Use this array if you need to configure proxy access and so on

$err = $f->selectTransport($trName,$trConf);
if (
PEAR::isError($err)) showError($err);

// Fetching tags
$url = "";
$tags = $f->getTags($url);
if (
PEAR::isError($tags)) showError($tags);

showError($err) {
"Error '".$err->getMessage()."' (".get_class($err).")");