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 "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


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">

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: Jun 15 2022
Copyright © 2022 Thunderstone Software LLC. All rights reserved.