Saturday 14 July 2012

Imacros Article Finder


I just finished creating an Imacros script that will search ezinearticles.com for your specific keyword take the top ten results, rewrite them, and then save them in your Imacros downloads folder.
In more detail, the script will rewrite the articles using Google Translator to translate them into French and then back into English. I know this is not the best way to go about rewriting articles, but for my purpose I think it will be OK. If anyone else knows of a free fully automatic online article spinner that is better let me know and I can change it to utilize that tool fairly easily.
To use the tool you simply play the macro and enter in your keyword when asked. Then sit back and watch as it gathers 10 fresh articles for you. There is, however, a possibility that an author appears in your top 10 results in which case the script will just keep going and you will have an empty article.
Anyway here is the code:
keyword = prompt("Enter your article keyword(s)", "");

macro = "CODE:\n";
macro += "TAB T=1\n";
macro += "URL GOTO=http://ezinearticles.com/\n";
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://ezinearticles.com/results/ ATTR=NAME:q CONTENT="+keyword.replace(/ /gi, "<SP>") +"\n";
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://ezinearticles.com/results/ ATTR=NAME:sa&&VALUE:Google<SP>Search\n";
macro += "FRAME F=1\n";
macro += "TAG POS=1 TYPE=img ATTR=ALT:Google EXTRACT=TXT\n";
macro += "SET !EXTRACT NULL\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
macro += "TAG POS=R1 TYPE=a ATTR=* EXTRACT=HREF\n";
retcode = iimPlay(macro);
extract = iimGetLastExtract();
//alert(extract);
urls = extract.split("[EXTRACT]");

for (i = 0; i < urls.length; i++) {
    //alert(urls[i]);
    macro = "CODE:\n";
    macro += "URL GOTO="+urls[i]+"\n";
    macro += "TAG POS=1 TYPE=div ATTR=ID:body EXTRACT=TXT\n";
    macro += "URL GOTO=http://translate.google.com/#\n";
    macro += "TAG POS=1 TYPE=TEXTAREA FORM=NAME:text_form ATTR=ID:source CONTENT={{!EXTRACT}}\n";
    macro += "TAG POS=1 TYPE=SELECT FORM=NAME:text_form ATTR=ID:old_sl CONTENT=%en\n";
    macro += "TAG POS=1 TYPE=SELECT FORM=NAME:text_form ATTR=ID:old_tl CONTENT=%fr\n";
    macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:text_form ATTR=ID:old_submit\n";
    macro += "SET !EXTRACT NULL\n";
    macro += "TAG POS=1 TYPE=SPAN ATTR=ID:result_box EXTRACT=TXT\n";
    macro += "URL GOTO=http://translate.google.com/#\n";
    macro += "TAG POS=1 TYPE=TEXTAREA FORM=NAME:text_form ATTR=ID:source CONTENT={{!EXTRACT}}\n";
    macro += "TAG POS=1 TYPE=SELECT FORM=NAME:text_form ATTR=ID:old_sl CONTENT=%fr\n";
    macro += "TAG POS=1 TYPE=SELECT FORM=NAME:text_form ATTR=ID:old_tl CONTENT=%en\n";
    macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:text_form ATTR=ID:old_submit\n";
    macro += "SET !EXTRACT NULL\n";
    macro += "TAG POS=1 TYPE=SPAN ATTR=ID:result_box EXTRACT=TXT\n";
    macro += "SAVEAS TYPE=EXTRACT FOLDER=* FILE="+keyword.replace(/ /gi, "_")+"_"+i+".txt\n";
    retcode = iimPlay(macro);
    extract = iimGetLastExtract();
    article = temp[temp.length-1];
}
One example that I plan on using this code for is to make things like linkwheels 

No comments:

Post a Comment

Twitter Bird Gadget