#!/usr/bin/perl # Author: gendou # Usage: ad-update.pl username password [tag] [regex] # Version: 1.0.0 ### CONSTANTS ### $usage = "Usage: ad-update username password [tag] [regex]\n"; $alexadex = 'http://alexadex.com/ad'; ### COMMAND LINE ARGUMENTS ### $username = shift or die($usage); $password = shift or die($usage); $tag = shift or $tag = ''; $regex = shift or $regex = '.*'; ### LOGIN TO ALEXADEX ### $data = `curl -s -i -d page=signin -d username=$username -d password=$password -d postback=1 $alexadex/`; $uid = $1 if($data =~ /ad_user_id="(.+?)"/); $sid = $1 if($data =~ /ad_authenticate="(.+?)"/); $cookies = "-b 'ad_user_id=$uid;ad_authenticate=$sid'"; ### UPDATE STOCK PRICES ### for $line (`curl -s $cookies $alexadex/user?tag=$tag&count=1`) { if($line =~ />