PRODUCT






Home









Free Download








Installation Instructions





FAQ





FAQ








Ask A Question





LEARN SCRIPTING





Overview








Lesson 1








2


3


4


5








Exam





SAMPLE SCRIPTS





Computer








Internet








Administrators








Developers








Data








Miscellaneous





HELP / DOCUMENTATION





Commands








Automated Internet








Automated Editors








Sample Scripts








Precompiled Functions








System Features






  Help Page - SS_CureURL

( Some help pages may not display correctly in html because those help pages may have sample code
in them, part of which may be mis-interpreted as html tags.

All help pages, including this help page, are available in biterScripting with the help command. )




Sample Script SS_CureURL Purpose Formats (and cures) a URL Address. ##################################################################### # SCRIPT: SS_CureURL # # This script takes a URL and removes extraneous portions from it, # such as /./ # # This script writes the cured URL to output. # # The input URL is passed with FVA for str variable $URL. # # This script can be stored, and edited as needed, in a file called # SS_CureURL.txt. The script can then be called as # # script SS_CureURL.txt URL("http://www.mycompany.com/./index.html") # ##################################################################### # Declare FVA variables. var str URL var str preStr var str postStr # Replace each instance of /./ to / while ( { sen "^/./^" $URL } > 0 ) do stex "]^/./^" $URL >$preStr stex "^/./^[" $URL >$postStr set $URL = $preStr+"/"+$postStr done # Replace each instance of // to / # (We will replace the resulting ":/" to "://" at the end.) while ( { sen "^//^" $URL } > 0 ) do stex "]^//^" $URL >$preStr stex "^//^[" $URL >$postStr set $URL = $preStr+"/"+$postStr done # Replace the first instance of ":/" (after http, ftp, etc) to "://" if ( { sen "^:/^" $URL } > 0 ) do stex "]^:/^" $URL >$preStr stex "^:/^[" $URL >$postStr set $URL = $preStr+"://"+$postStr done endif # Translate %20 to space. while ( { sen -r "^%20^" $URL } > 0 ) do stex "]^%20^" $URL > $preStr stex "^%20^[" $URL > $postStr set $URL = $preStr+" "+$postStr done # If this URL has a mailto: in it, this is not a good URL. if ( { sen -c "^mailto:^" $URL } == 0 ) echo $URL endif

2008-2013, biterScripting.com. All rights reserved.
biterScripting, biterScript, biterBrowser, biterMobile, biterScripting.com, FVA (Forward Variable Assignment) are trademarks of biterScripting.com. Is it biterScripting-compatible ? is a service mark of biterScripting.com. Explorer, Unix, Windows are trademarks, service marks or other forms of intellectual property of their respective owners.