Yadabyte
 
 
Writing a Raid Script
 
Definition
 
Processes
 
Raid Script Structure
 
Variables
 
Assigning Article categories
 
Designing and Testing Raid Scripts
 
Raid Script Commands (Comments)
 
Raid Script Commands (Specifiers)
 
Raid Script Commands (Quantifiers)
 
 
Raid Script Commands (Built-in Functions )
 

Part 4: Variables

Variables: Input Variables

Input variables contain text that is provided automatically by the script processing (URL and LINK) or by specific commands (LINE from FIND_LINE).

  • URL: This variable will contain the full URL of the current article page.
  • LINK : This variable contains the URL of the extracted links. This is in a form of a list of URLs. LINK refers to once instance in this list, when LINK is used in a process which is called using REPEAT_FOR_ALL_LINKS.
  • LINE: Whenever the FINDLIND command finds a line matching its criteria then the contents of that line are automatically copied into the LINE variable. Note that a line in this sense is a single line of text truncated by a new line character.
  • PAGE: This holds the complete page once DOWNLOAD_PAGE is called.
  • BODY: This holds the entire page text of the article as defined by the ARTICLE_START and ARTICLE_END specifiers.

Variables: Output Variables

Output variables contain text that can only be acquired from another variable (VAR). Output Variables are used to send specific text for Article categories, dates, authors and so forth. If you write raid scripts you should always aim for them to "fill up" all of the Output Variables.

  • DATE: Contains the article date. Note that NewsRaider will automatically set the date the file was downloaded but its better to try to fill the DATE variable as well.
  • CATEGORY: Contains the type of category of the article (Sport , politics, ETC).
  • AUTHOR: Contains the name of the person who wrote the article.
  • TITLE: Contains the title text and thus it is really important you fill this variable. If it is not filled the article title will be the cumbersome SOURCE+date+time, eg CNN-01/01/2005-17.45

Variables: VAR

Input and Output variables are not much use for anything other than giving or receiving text. The only variable that can have its contents changed is called VAR.

But, to make things easier for you, we have introduced 10 variable stores where you can store the value of VAR. (Refer STORE_VAR_1 and RETRIEVE_VAR_1). This makes the total number of variables available 10.

Maybe future versions of the Raid Script language will have more variables but the main aim is simplicity for all, so right now we are seeing what can be achieved with one variable.

Notes:

  1. All Commands that operate on VAR start with VAR, eg VAR_REPACE

 
 | Site Map | Copyright © 2005 Yadabyte. All Rights Reserved. Site by Yadabyte Websites..
Yadabyte