Another Free Script for You Fuckers!

Status
Not open for further replies.

mattgatten

New member
May 1, 2008
150
0
0
Ok, I made this one based on my own needs. I wanted to be able to pile a bunch of related keywords together and then get all the possible phrases that could be generated from those keywords. I also wanted to specify the length of the phrase. This script does that. It's just a javaScript so it's completely client-side. You don't even have to be connected to the internet. It's just a tool I like to use.

You put in your keywords under the commented line. Then change the number under the 2nd commented line. Save it, double click it, click 'allow active content'. You're done. It's pretty fast too.

Warning, if you jam 20 keywords in there and tell it to spit out large phrases, you might clog up IE. A 'packaged non-IE version can be added here as well. If you have any suggestions or requests, shoot!

Let me know what you think.

Matt

Code:
[SIZE=2]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"[/SIZE]
[SIZE=2]"http://www.w3.org/TR/html4/loose.dtd">[/SIZE]
[SIZE=2]<html>[/SIZE]
[SIZE=2]<head>[/SIZE]
[SIZE=2]<title>Untitled Document</title>[/SIZE]
[SIZE=2]<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">[/SIZE]
[SIZE=2]</head>[/SIZE]
[SIZE=2]<body> </body>[/SIZE]
[SIZE=2]</html>[/SIZE]
[SIZE=2]<script type="text/javascript">[/SIZE]
[SIZE=2]//put your keyworks here. Separate them by a space[/SIZE]
[SIZE=2]var string = "word-1 word-2 word-3 word-4"; [/SIZE]
[SIZE=2]var keys = string.split(" ");[/SIZE]
[SIZE=2]//how many words you want each phrase to be[/SIZE]
[SIZE=2]var phrases = new Array(3);[/SIZE]
 
[SIZE=2]var maxVal = keys.length-1;[/SIZE]
[SIZE=2]var index = phrases.length-1;[/SIZE]
 
[SIZE=2]for(var i = 0; i < phrases.length; i++){[/SIZE]
[SIZE=2]phrases[i] = 0;[/SIZE]
[SIZE=2]} [/SIZE]
 
[SIZE=2]//while we're not at the first index and it's value is not more than the array length.[/SIZE]
[SIZE=2]var phraseCount = 0; [/SIZE]
[SIZE=2]while(index >= 0 && phrases[index] < keys.length){[/SIZE]
[SIZE=2]phraseCount++; [/SIZE]
[SIZE=2]getKeys(phrases); [/SIZE]
[SIZE=2]index = phrases.length-1; [/SIZE]
[SIZE=2]if(phrases[index] != keys.length-1){[/SIZE]
[SIZE=2]phrases[index]++;[/SIZE]
[SIZE=2]}else{[/SIZE]
[SIZE=2]while(phrases[index] == keys.length-1){[/SIZE]
[SIZE=2]phrases[index] = 0;[/SIZE]
[SIZE=2]index--;[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]phrases[index]++;[/SIZE]
[SIZE=2]} [/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]function getKeys(phrases){ [/SIZE]
[SIZE=2]var dupes = 0; [/SIZE]
[SIZE=2]for(var i = 0; i < phrases.length; i++){ [/SIZE]
[SIZE=2]for(var x = 0; x < phrases.length; x++){[/SIZE]
[SIZE=2]if(phrases[i] == phrases[x]){ [/SIZE]
[SIZE=2]dupes++;[/SIZE]
[SIZE=2]} [/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]if(dupes <= phrases.length){[/SIZE]
[SIZE=2]for(var i = 0; i < phrases.length; i++){[/SIZE]
[SIZE=2]document.write(keys[phrases[i]] + " "); [/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]document.write("<br />");[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
 
 
[SIZE=2]</script>[/SIZE]
 


Status
Not open for further replies.