Example Script

The following is a small example script that illustrates use of the refInfo API. See the following pages for details on the functions used here.

<script language=vortex>

<a name=main public>
  <fetch url="http://www.example.com/"/>
  <urlinfo allrefs refInfo><$refs = $ret>
  <loop $refs>
    ----------
    URL: <$ret = (refInfoGetUrl($refs))> $ret
    <$tag = (refInfoGetTagName($refs))>
    <$attr = (refInfoGetSourceAttribute($refs))>
    <fmt "From tag/attr: %s/%s\n" $tag $attr>
    Link text: <$ret = (refInfoGetLinkText($refs))> $ret
  </loop>
</a>

</script>

Given the following example HTML page:

<a href="hrefLink.html">Click here</a>
<form method="GET" action="search.cgi">
  Query: <input type="text" name="q">
  <input type="submit" name="go" value="Go">
</form>

Then running the example script above on that example HTML page will produce the following output:

----------
URL: http://www.example.com/hrefLink.html
From tag/attr: a/href
Link text: Click here
----------
URL: http://www.example.com/search.cgi?q=
From tag/attr: form/action
Link text:


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.