Maximum Traffic Page Generator Nerd Lib Software Labs
Nerd Lib Software Labs - Home of Maximum Traffic Our Product Line Get Maximum Traffic Today Maximum Traffic Frequently Asked Questions Maximum Traffic Support Center
Nerd Lib News
 
02/08/2006
AdSense Guide
More Details
 
01/15/2006
50% off Sale
More Details
 
12/29/2005
Free Alexa Tips
Read Article
 
12/11/2005
MT: Xmas Update
See Patch Notes
 
12/08/2005
Traffic Scams
More Info
 

Read All Testimonials

Please include a website URL when you send us your testimonials!

Send a Testimonial



 - Sample Sites
 - Download V2
 - Send a Comment
 - Training Video
 - ArticleCity HowTo
 - RSS/XML Example
 - Scripting Intro

Nerd Lib Resources
Learn about Nerd Lib Software
Contact the Nerd Lib Support staff


To get the latest news on our software, please input the following;

E-mail address:


Full name:





 

affiliate programs



Free Web Hosting

Would you like to advertise here?

 


Maximum Traffic: A Generic Script

Here's instructions on a generic script that should work with any HTML content source. It might even work with other formats, but for this example it only has to deal with HTML.

How to make use of Request Variables will also be briefly covered.

In this example, we're going to use http://www.google.com/ as our source.

Using the Generic Script

Step 1: Download Script
Save the file: custom_Google.js.txt as custom_Google.js (without the .txt extension), in your 'scripts/content' folder. This folder is in theMaximum Trafficinstallation folder.

An easy way to get to it is to open the program, and click on one of the Open buttons.

From there go up one folder to the base program folder, and then navigate to the 'scripts' folder.

We are working with Content scripts, inside the scripts folder go to the 'scripts/content' folder.

Step 2: Analyze the Target URL
The software needs to know what information to send to the server. In a GET or POST method, this information is in the form of Request Variables .

Basically this just means that we have to tell the program what boxes to fill out on the form and what the submit button is named.

This is done by analyzing the HTML source at the target URL. For this example we browse to http://www.google.com/ and view the source code to the page.

In this particular example, the target URL source code isn't very pretty. It's also a good example of how even the most ugliest of code can be very easily cut up for you.

In the source code to the page, we are looking for the following:
  • <form method="XXXX" action="YYYY">
  • <input name="XXXX" value="YYYY">
  • <select name="XXXX"> and <option value="YYYY"> inside the <select>
  • <textarea name="XXXX">YYYY</textarea>
These are all the different types of HTML form tags, you will want to become familiar with these. You can just work with the HTML source from the target URL in a text editor, and remove all <tags> that don't belong to the form you want to submit.


Ripped out, the form part of the source code at http://www.google.com looks like this:

<form action=/search name=f>
<input type=hidden name=hl value=en>
<input maxLength=256 size=55 name=q value="">
<input type=submit value="Google Search" name=btnG>
<input type=submit value="I'm Feeling Lucky" name=btnI>
</form>

The important values have been outlined, so basically this form gives us:

Method:		GET
(If method is not specified, the default is GET)

Feed URL:		http://www.google.com/search
(The base URL path + the 'action' of the form)

Request Variables:

	Variable  =  Value
	hl        =  en
	q         =  %KEYWORD%	
	btnG      =  Google Search

Notes:
In the search string, we can use %KEYWORD% to say 'the current keyword'
For a random webpage, use "I'm Feeling Lucky" instead of "Google Search"

With this information, we'll return to the software and configure it to pull data from this source.
 

Step 3: Setup Content Source
The file 'scripts/content/custom_Google.js' should be in your 'scripts' folder from Step 1, so go to the Content Sources screen now. Click New on the bottom left of the Content Sources screen to start a new one.

The Content Source should be configured using the following values:
 

Request Method:	GET

Timeout:		30

Feed URL:		http://www.google.com/search

Referer URL:	http://www.google.com

Parse Script:	custom_Google.js

Add each of the Request Variables as a 'Request' variable by clicking Add in the Request Variables section of this content source. The form variables are most likely cAsE sensitive, so you must enter them exactly as they were on the original HTML source.

Refer to the table in Step 2 for what the form variables names and values are.
 


Step 4: Test the Content Source
Click the Save button to save this new Content Source, you can call it 'Google' or whatever you like.

Now select the new Content Source that you saved, it should appear in the list of Content Sources. With it selected, click the Test button found above the Save button.

You should see some content appear when the operation completes. If you didn't you should double check that you followed all of the steps above and that the Content Source is configured exactly as explained.

Step 5: Copy and Customize
Now that you've got it working, you may want to customize it a little.

Edit the file custom_Google.js in your 'scripts/content' folder. You should see something like this near the top of the file:
 

// SET THIS TO 1 (ONE) TO REMOVE HTML TAGS, OR 0 (ZERO) TO LEAVE THEM IN
public static var iStripTags	= 1;


// THIS IS A WORD THAT IF FOUND THE CONTENT PEICE WONT BE ADDED
// SET THIS TO "" OR SOMETHING LIKE "ABCDEFG01010101" TO DISABLE
public static var sDontShow		= "Google Home";


// HTML IS SPLIT INTO PEICES DEPENDING ON THIS TAG
// THIS MEANS PULL PEICES OF CONTENT BETWEEN <P> TAGS BY DEFAULT
public static var sTag		= "p";


// URL OF YOUR CHOICE, CAN BE USED AS {URL} IN CONTENT TEMPLATE
public static var sContentURL	= "http://your.domain.com/";


// TITLE OF YOUR CHOICE, OR "{KEYWORD}"
// CAN BE USED IN CONTENT TEMPLATE AS {TITLE}
public static var sContentTitle	= "{KEYWORD}";

The above settings are how you customize how this script will work.

iStripTags: Whether or not to strip away HTML elements (Links, Tables, etc) from the fetched content.

sDontShow: Can contain a word not to show, an example is shown for Google (to exclude their site links)

sTag: Set to the <HTML TAG> the script grabs content from 'inside' of, for example:
  • sTag = "td"; would grab <td>the content inside</td>
  • sTag = "div"; would grab <div>the content inside</div>
sContentURL: Available in the Template Editor (Content section) as the {URL} variable.

sContentTitle: Available in the Template Editor (Content section) as the {TITLE} variable.

If you leave this set to {KEYWORD} the current keyword will be substituted during the generation cycle.

 

That is all there is to using this script, you can copy it to a new file and modify it for some new sources now!

P.S. - The above script should work for extracting data out of XML feeds as well.


For more information on using JScript .NET:

JScript .NET Manual: JScript .NET Language Reference (JScript)

JScript .NET on Google: Click to Visit



Maximum Traffic Version 2.0

Download Now | Buy Now



Maximum Traffic
Version 2.0



FREE TRIAL
DOWNLOAD

(15-Day Time Limited)

Minimum Requirements
Installation Video
Release Notes

 

 

 

Credit Card Processor
 


Thank you for making Maximum Traffic the #1 Traffic Generation program on the net!

Click here for more great products.




02/08/2006
AdSense Guide

01/15/2006
50% off Sale

12/29/2005
Free Alexa Tips

12/11/2005
MT: Xmas Update

12/08/2005
Traffic Scams

11/07/2005
Sample Sites

11/04/2005
10 Google Tips

10/27/2005
KeywordFinderz

10/26/2005
Script Update

10/23/2005
Major Update

10/05/2005
Content Sources

10/03/2005
MT Installation Guide

09/28/2005
MT Image Converter

09/27/2005
Advertising Options

09/22/2005
MT Image Cropper

09/18/2005
Content Sources

09/15/2005
MT Thumb. Generator

09/13/2005
MT Template Wizard

09/12/2005
Meta Helper v1.0

09/01/2005
Our Letter


View All Articles


Increase your traffic with Maximum Traffic