Hi Tom,

> I am working on a search for the daily static...I am
> trying to figure out the pattern they use to come up
> with the name so I can compose it given the date.

I would just use an XmlHttp hit the first time, pattern match "uf*.gif",
and then a second request for the image. This is some code I've migrated
from one of my homebrew samples. Save it as a new htm file:

'// ========================================================
<html>
<head>

<title> Test </title>

<script language="javascript">

var ksRoot = "http://www.userfriendly.org/cartoons/";;

function showImage( sImage ){
        var s = '';
        try{
        //attempt to obtain the content
          var sUrl  = "http://ars.userfriendly.org/cartoons/?id="; +
sImage;
          var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
          xmlHttp.open("GET", sUrl, false);
          xmlHttp.send();

        //get the response content from the remote site
          var sBody = xmlHttp.responseText;
          var rx = /(\/archives\/[0-9a-zA-Z]+\/uf[\d]+\.gif)/g;
//3456789`123456789`123456789`123456789`123456789`123456789`123456789`
          var r; var i = 0;
          if ((r = rx.exec(sBody)) != null){
            sParsed = r[1];
          }
          sParsed = sParsed.substr(1);

        }catch(e){
          alert( "It didn't work!" + "\n" + e.number + "::" +
e.description);
        }

        var o = document.getElementById('testimg');
        o.src = ksRoot + sParsed;
}

</script>

</head>
<body>

<img src="http://12pointdesign.com/stock/images/ra-button.gif";
id="testimg" /> <br />

<a onclick="javascript:showImage('20060120');"> 20060120 </a> <br />
<a onclick="javascript:showImage('20060121');"> 20060121 </a> <br />
<a onclick="javascript:showImage('20060122');"> 20060122 </a> <br />
<a onclick="javascript:showImage('20060123');"> 20060123 </a> <br />

</body>
</html>
'// ========================================================

Regards,

Shawn K. Hall
http://12PointDesign.com/




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
DQSD-Users@lists.sourceforge.net
http://sourceforge.net/mailarchive/forum.php?forum_id=8601

Reply via email to