Script Library: 1214 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Documentation for: countweb.r


Usage document for %countweb.r

1. Introduction to %countweb.r

This library script is an example for scanning web pages. It scans a list of sites and counts the occurances of a string.

2. countweb At a Glance

 >> system/options/quiet: true
 >> do %countweb.r
 47 http://www.rebol.com
 15 http://www.sassenrath.com
 0 http://www.amiga.org
 0 http://www.cnn.com
 
Counted the times the string REBOL occured in the listed site's home pages.

3. Configuring %countweb.r

Change the string to look for in the string: variable
Change the sites to scan in the sites: block

4. What you can learn

4.1. Easy web page reader

What other language do you know that can read in a web page with read http://sitename.com

4.2. find/tail

This example show how easy it can be to scan through a page of text with the line

 while [page: find/tail page string] [count: count + 1]
 

4.3. set-words

That same line shows off REBOL assignment, or set-word in REBOL speak.

5. Credits

  • %countweb.r original author: Unknown
  • Usage document by Brian Tiffin, Library Team Apprentice, Last updated: 28-Apr-2007