PHP Classes

File: Implementation

Recommend this page to a friend!
  Classes of Aziz S. Hussain   Email Scraper   Implementation   Download  
File: Implementation
Role: Example script
Content type: text/plain
Description: Implementation of class
Class: Email Scraper
Crawl pages and scrape e-mail addresses into MySQL
Author: By
Last change: Added include.
Date: 15 years ago
Size: 851 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
$DB_USER
= 'root';
$DB_PASSWORD = '';
$DB_HOST = 'localhost';
$DB_NAME = 'scrape';
$dbc = mysql_connect ($DB_HOST, $DB_USER, $DB_PASSWORD) or $error = mysql_error();
mysql_select_db($DB_NAME) or $error = mysql_error();
mysql_query("SET NAMES `utf8`") or $error = mysql_error();
if(
$error){ die($error);}

include(
'scraper.class.php');

$new = new scraper;
// Start Path can be empty, which will be extracted from the start URL
$new->setStartPath();
//$new->setStartPath('http://forums.digitalpoint.com');
$new->startURL('http://forums.digitalpoint.com/forumdisplay.php?f=37');
$new->startScraping();
?>
</body>
</html>