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 )
 

Raid Script Commands

Specifiers

These are commands that say where or what something is. It might be telling raid Script where a logo image is to be found or where the Article text begins and ends.

 

START_URL= "Atext$"

Usage:

This tells the Raid script where the start page that all articles will link from can be found.

Examples START_URL="http://www.cnn.com/news.htm"

 

BASE_URL= "Atext$"

Usage:

In many cases the Links in the start page will be partial links that are appended to the base URL of the site. Because of this you should specify the BASE URL if it is different from the START URL.

Examples

START_URL="http://www.cnn.com/news.htm"

BASE_URL="http://www.cnn.com/"

 

SOURCE = "Atext$"

Usage:

This Specifier allows you to set the text name of the site, eg "CNN.com" or "BBC News".

 

ARTICLE_FROM "Atext1$" TO "Atext2$"

Usage:

This command specifies where the article body begins within the HTML of the Artcile page. Everything after the first occurrence of Atext1$ will form the page text of the article. This is ended by the first occurance of Atext2$.

 

SECTION_FROM "Atext1$" TO "Atext2$"

Usage:

This command specifies where the useful part of the downloaded page. Anything before Atext1$ and anything after Atext2$ are ignored and will not be processed. Can use this for article extraction as well as link extraction.

 

IMAGE_LOGO="URL$"

Usage:

This Specifier defines where the Logo image for the Newsraider article can be found on the site. The logo image is the one that appears at the top of every page in NewsRaider.

Notes:

  1. Once a Logo image is found it will automatically be cached and used without being downloaded again with each script run.
If not specified the Articles from this source wont have any logo.

 

IMAGE_FAVICON="URL$"

Usage:

This Specifier defines where the Favicon for the site is to be found. These are the tiny icons that most sites use for highlighting themselves in bookmarks, NewsRaider uses them in the Article Index view to highlight the Article source.

The normal location of Favicons is http://www.sitename.com/favicon.ico

 

IMAGE_DEFAULT_FAVICON = "generic name.ico"

Usage:

If a site does not have a Favicon then you can use one of the generic ones provided by NewsRaider. The available Favicons are found in C:\articles\lozenge

Examples

IMAGE_DEFAULT_FAVICON = "music.ico"

IMAGE_DEFAULT_FAVICON = "science.ico"

 

OUTPUT_TO_FILE_NAME = "filename"

Usage:

Used in Raid scripts. Ignored in NewsRaider.

This command specifies the name of the output TomeRaider file when the script is run in script raider.

Examples

OUTPUT_TO_FILE_NAME = "abc"

 

VAR_START

Usage:

A text string location specifier. Used in many commands to denote the start of the string.

Examples

VAR_INSERT_AT VAR_START "<p>"

 

VAR_END

Usage:

A text string location specifier. Used in many commands to denote the end of the string.

Examples

VAR_INSERT_AT VAR_END "</p>"

 

INCLUDE_FORWARD_SLASH_LINK_ENDINGS

Usage:

By default, when extracting links from a page, hyperlinks which end with "/" are ignored from the script processor. If this command is called in BEGIN_DEF section, hyperlinks which end with "/" are also extracted.

Examples

INCLUDE_FORWARD_SLASH_LINK_ENDINGS

 

PRIMARY_CATEGORY

Usage:

Can be used to assign the value of the primary category.

Examples

VAR = BODY

// . some processing to VAR

PRIMARY_CATEGORY = VAR

//Or

PRIMARY_CATEGORY = "Science"

 

SECONDARY_CATEGORY

Usage:

Can be used to assign the value of the secondary category.

Examples

SECONDARY_CATEGORY = "Nature"

 

REGION

Usage:

Can be used to assign the value of the region.

Examples

REGION = "Asia"

 

AUTHOR

Usage:

Can be used to assign the value of the author.

Examples

AUTHOR = "James Smith"

 

COVER_TEXT

Usage:

This command is not used in NewsRaider, and applicable in SiteRaider and Tester only.

Can be used to assign HTML formatted text to be shown in cover page of the output TR file. This is an optional command.

Examples

COVER_TEXT = "English Dictionary of <B>150,000</B> words."

 

COVER_IMAGE

Usage:

This command is not used in NewsRaider, and applicable in SiteRaider and Tester only.

Can be used to assign URL of the cover page image to be shown in cover page of the output TR file. This is an optional command.

Examples

COVER_IMAGE = "http://www.websitenamehere.com/images/cover.jpg"

 

RS_VERISON

Usage:

This is an optional command where the author can specify the minimum version of the RaidScript Engine required to run the script.

Examples

RS_VERSION = 1.002

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