Feb 25
Marc Pinnell Checking A List of Sites...
Feb 25, 2015; 21:00
Marc Pinnell
Checking A List of Sites...
Hey all,
I have a script that runs through the sites that I host checking for response time, whether they are up and operating properly (by verifying a string exists), etc. Results are written to a file for later retrieval. Been wondering if there was a better, more efficient manner to do this. I've noticed that many times the "timer" results that this script reports do not match the same load times I get with say Chrome.
My code is below, feel free to pick it apart! :)
//NOW CHECK THE SITE
protect => {
local(
sTime = _date_msec,
lc = 1
)
$urlReturn = (
include_url('http://' + #oneSite + '/',
-sendmimeheaders=array('User-Agent'='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6'),
-timeout = 3,
-retrieveMimeHeaders = 'site_headers',
-options=array(CURLOPT_FOLLOWLOCATION=1),
-string=TRUE
));
//CHECK FOR STRING
with oneString in $matchstrings do {
if($urlReturn >> #oneString) => {
$sverified = 'Y'
loop_abort
}
}
//PROCESS RESPONSE HEADER
$scode = string_extract($site_headers->split('\r\n')->first->asString, -startposition=10, -endposition=12)
$ltime = decimal(_date_msec - #sTime)
}
marc
Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Feb 25
Steve Piercy - Website Builder Re: Checking A List of Sites...
Feb 25, 2015; 22:22
Steve Piercy - Website Builder
Re: Checking A List of Sites...
Feb 26
Bil Corry Re: Checking A List of Sites...
Feb 26, 2015; 08:20
Bil Corry
Re: Checking A List of Sites...
Feb 26
Jason Huck Re: Checking A List of Sites...
Feb 26, 2015; 09:06
Jason Huck
Re: Checking A List of Sites...
Feb 26
Marc Pinnell Re: Checking A List of Sites...
Feb 26, 2015; 15:25
Marc Pinnell
Re: Checking A List of Sites...
Feb 26
Marc Pinnell Re: Checking A List of Sites...
Feb 26, 2015; 15:29
Marc Pinnell
Re: Checking A List of Sites...
Feb 26
Steve Piercy - Website Builder Re: Checking A List of Sites...
Feb 26, 2015; 15:51
Steve Piercy - Website Builder
Re: Checking A List of Sites...
Feb 26
Steve Piercy - Website Builder Re: Checking A List of Sites...
Feb 26, 2015; 15:53
Steve Piercy - Website Builder
Re: Checking A List of Sites...
Feb 26
Brian K. Middendorf Re: Checking A List of Sites...
Feb 26, 2015; 17:00
Brian K. Middendorf
Re: Checking A List of Sites...