This script scrapes a web page and sends the scraped content.
- scrape a web page
- send a e-mail with the scraped result
- Download ZIP file from https://github.com/hshimo/scrape_mail
- git clone https://github.com/hshimo/scrape_mail.git
- Download a packed file.
- Unpack the file.
- That's all.
- copy default mail setting file
% cd Config
% cp mail.default.php mail.my.php
- edit a mail setting file. (ex. From, To, Subject, etc)
- set send mail flag to true.
% cd Config
% vi init.php
change a following line:
define('SM_SEND_MAIL_FLAG', false);
Default:
% php ./scrape_mail.php
Select a controller. For example: Digg controller or Slashdot controller
% php ./scrape_mail.php -c digg
% php ./scrape_mail.php -c slashdot
Select a controller and a action. (not implemented yet)
% php ./scrape_mail.php -c digg -a index
- make a FooController.php file under Controller directory.
- make a FooModel.php file under Model directory.
- implement
% crontab -e
# hourly
0 * * * * /usr/bin/php -f /home/user/scrape_mail/scrape_mail.php
only tested on
- PHP 5.3.15
- Mac OS X 10.6
Welcome!
- fork on GitHub
- send a pull request
- 2013-08-07: alpha version released
- [] put the version
- [] get options from command line
- [] move get options function into Lib/
- [] implement verbose option
- [] implement help option
- [] view & template
- [] HTML mail
- [] beforeFilter, afterFilter
- [] only japanese locale for sendMail library
- [] write test case
- [] output to other resources (database, twitter, facebook)