Login   Register  
PHP Classes
elePHPant
Icontem

File: class_google_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of MARY Matthieu  >  Google_Query  >  class_google_example.php  >  Download  
File: class_google_example.php
Role: Example script
Content type: text/plain
Description: how to install and use this class
Class: Google_Query
Retrieve the count of results of Google query
Author: By
Last change:
Date: 2004-01-23 12:52
Size: 2,549 bytes
 

Contents

Class file image Download
<html>
    <head>
        <title>Class_google_examples</title>
    </head>
    <body>
<ul>
    <li>INSTALL<br />Just put the class_google.php file in your include_path (see php.ini include path section if you are not sure)</li>
    <li>USES:<br />
        I'll try to show you this class and how To set up a search with exemples:
        <ul>
            <li><u>1: Searching phpclasses.org in title:</u>
                <ul>
                    <li>to declare a google object:<br />$google = new google();</li>
                    <?php
                    set_time_limit
(0);
                    require_once 
'class_google.php';
                    
$google = new google();
                    
?>
                    <li>set up parameters: search sentence phpclasses.org in title<br />$google->setSentence('phpclasses.org');</li>
                    <?php
                    $google
->setSentence('phpclasses.org');
                    
?>
                    <li>set up parameters: search sentence phpclasses.org in title<br />$google->setPosition('title');</li>
                    <?php
                    $google
->setPosition('title');
                    
?>
                    <li>get Results <br /><?php echo $google->getResults(); ?> Results found for query (<?Php echo $google->getLink()?>)</li>
                    <?php
                    
unset($google);
                    
?>
                </ul>
            </li>
            <li><u>2: Searching phplibrairies:</u>
                <ul>
                    <li>to declare a google object:<br />$google = new google();</li>
                    <?php
                    
require_once 'class_google.php';
                    
$google = new google();
                    
?>
                    <li>set up parameters: search PHPLIBRAIRIES<br />$google->setSentence('php librairies');</li>
                    <?php
                    $google
->setSentence('php librairies');
                    
?>
                    <li>get Results <br /><?php echo $google->getResults(); ?> Results found for query (<?Php echo $google->getLink()?>)</li>
                    <?php
                    
unset($google);
                    
?>
                </ul>
            </li>
            <li><u>2: Searching PHP in pdf files:</u>
                <ul>
                    <li>to declare a google object:<br />$google = new google();</li>
                    <?php
                    
require_once 'class_google.php';
                    
$google = new google();
                    
?>
                    <li>set up parameters: search php<br />$google->setKeywords(array('php'));</li>
                    <?php
                    $google
->setKeywords(array('php'));
                    
?>
                    <li>set up parameters: in pdf files<br />$google->setfiletype('pdf');</li>
                    <?php
                    $google
->setfiletype('pdf');
                    
?>
                    <li>get Results <br /><?php echo $google->getResults(); ?> Results found for query (<?Php echo $google->getLink()?>)</li>
                    <?php
                    
unset($google);
                    
?>
                </ul>
            </li>
        </ul>
    </li>
</ul>
Contact or more informations <a href="http://www.phplibrairies.com" target="_blank">phplibrairies</a>
    </body>
    
</html>