pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit c5e93181465ce2053f7975f9ad73d635c866b98d
parent cbbbc368fa6097d38e0fd3aad4d49e05e1f9ae13
Author: Kyle R W Milz <kyle@getaddrinfo.net>
Date:   Wed, 13 Aug 2014 22:36:45 -0600

product_scraper: use email and smtp from config file

Diffstat:
MShared.pm | 2+-
Mpricechart.cfg | 2++
Mproduct_scraper.pl | 4++--
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Shared.pm b/Shared.pm @@ -41,7 +41,7 @@ sub get_config }, }, general => { - _vars => ['http_path', 'log_path', 'user_agent'], + _vars => ['http_path', 'log_path', 'user_agent', 'email', 'smtp'], }, }); diff --git a/pricechart.cfg b/pricechart.cfg @@ -4,6 +4,8 @@ http_path = /var/www/htdocs/pricegraph log_path = pricechart_log.txt # Chrome 36 Win7 64bit user_agent = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36; +email = kyle@getaddrinfo.net +smtp = smtp.getaddrinfo.net *** vendors *** diff --git a/product_scraper.pl b/product_scraper.pl @@ -155,7 +155,7 @@ my $date = strftime "%d/%m/%Y", localtime; my $e_mail = Email::Simple->create( header => [ From => "Santa Claus <sc\@np.com>", - To => "kyle\@getaddrinfo.net", + To => $cfg->{general}{email}, Subject => "PriceChart product scrape $date", ], body => $email); @@ -163,7 +163,7 @@ my $e_mail = Email::Simple->create( print $e_mail->as_string(); my $sender = Email::Send->new({mailer => 'SMTP'}); -$sender->mailer_args([Host => 'smtp.getaddrinfo.net']); +$sender->mailer_args([Host => $cfg->{general}{smtp}]); $sender->send($e_mail->as_string()); #for (keys %title_dict) {