WIZ-OVER01.ALT

This is an OutWit Tutorial file.


Testing Browser...
OutWit Hub - Quick Overview
Application walkthrough: user interface and main features
userSpace.waitOK = witscript.version("4") || !/Firefox\/2\d\./.test(navigator.userAgent); userSpace.restoreOriginalPrefs = function restoreOriginalPrefs(){ if(userSpace.originalPrefs){ for(var thePref in userSpace.originalPrefs){ witscript.setPreference(thePref, userSpace.originalPrefs[thePref]); } } } userSpace.storeOriginalPrefs = function storeOriginalPrefs(){ if(!userSpace.originalPrefs){ userSpace.originalPrefs = {}; userSpace.originalPrefs["browse.tempo.min"] = witscript.getPreference("browse.tempo.min"); userSpace.originalPrefs["browse.tempo.max"] = witscript.getPreference("browse.tempo.max"); userSpace.originalPrefs["images.ondemandonly"] = witscript.getPreference("images.ondemandonly"); userSpace.originalPrefs["page.ignorePlugins"] = witscript.getPreference("page.ignorePlugins"); userSpace.originalPrefs["page.ignoreImages"] = witscript.getPreference("page.ignoreImages"); userSpace.originalPrefs["tableMinRows"] = witscript.getPreference("tableMinRows"); } } userSpace.setWizardPrefs = function setWizardPrefs(){ witscript.setPreference("browse.tempo.min", "2000"); witscript.setPreference("browse.tempo.max", "3500"); witscript.setPreference("images.ondemandonly", false); // witscript.setPreference("page.ignorePlugins", false); witscript.setPreference("page.ignoreImages", false); witscript.setPreference("tableMinRows", "1"); }
userSpace.eyeCatcherOK = !(wizardKit.platform=="mac" && /firefox/i.test(navigator.userAgent) && /rv:1[2-8]/i.test(navigator.userAgent) && !witscript.version("3")); if (/Firefox\/[23]\./.test(navigator.userAgent)){ alert("OutWit wizards cannot run on your version of Firefox. Please update to the current version and try again."); wizard.close(); } else if (!("witscript" in window) || !witscript.version || !witscript.version("2.0.1")){ alert("This wizard is not compatible with your version of the OutWit Kernel. Please download the latest version (2.0.1 or higher)"); wizard.close(); } if(witscript.version()=="2.1.1.4"){ alert("Version 2.1.1.5 was released with important fixes. Please update and restart the tutorial."); } if(witscript.version("2.1")){$(".owui-wizard-homelink").html("Hub Tutorials")}; userSpace.proFeature = witscript.proLicense() ? "" : " (pro feature)"; userSpace.storeOriginalPrefs(); userSpace.setWizardPrefs(); witscript.logPanel.setAttribute("height",0);
wizardKit.say(this.parentNode);


This tutorial is going to
take you through the
main features of the application.


While this window is showing instructions, the user interface of OutWit Hub remains operational.

if(!witscript.version("2.1")){ witscript.wait(500); var top = wizard.getPosition().top; var bottom = wizard.getPosition().bottom; var left = wizard.getPosition().left; var right = wizard.getPosition().right; var originalTop = top; var originalLeft = left; for(var i= 31;(i > -31) && (top > 0) && (bottom > 0) && (left > 0) && (right > 0) ;i-=3){ top = wizard.getPosition().top; bottom = wizard.getPosition().bottom; left = wizard.getPosition().left; right = wizard.getPosition().right; wizard.moveBy(8*Math.sin(i/10),5*Math.cos(i/10)); // witscript.wait(0); } wizard.moveTo(originalLeft,originalTop); witscript.wait(500); }
if (wizardKit.platform=="mac" && !wizardKit.speak){ $("#speakInstructions").html("Check the 'speak' checkbox below, if you want these instructions to be read to you."); } wizardKit.say(this.parentNode);

You can still interact normally with the application and you can move this tutorial window around on the screen to see the parts of the interface that you want.

witscript.views.page.display(); wizardKit.hideCatch(); wizardKit.hideLog(); var sampleSearches = ["tropical birds", "ballet dancing", "beauty", "grand canyon", "vermeer", "taj mahal", "eiffel tower", "paris", "fashion photography", "jungle book", "gothic cathedral", "fruit", "portman images", "race cars", "green flash", "new york city", "japan cherry blossom", "rainforest", "aurora borealis", "charlize theron", "Giant crystal cave", "william shakespeare", "autumn", "underwater images", "diamond cuts", "jolie photo", "giant space vegetable images", "banana tree", "volcano", "Edinburgh"]; var search = sampleSearches[Math.round(Math.random()*(sampleSearches.length-1))]; // alert("searching "+search); witscript.toolbar.search.setValue(search); witscript.toolbar.search.doSearch(); wizardKit.say(this.parentNode);

What is Outwit Hub?

witscript.menutree.focus(); if(userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.menutree.treechildren,1,.8); wizardKit.say(this.parentNode);

1. It's a Data Extractor built in a Web Browser

In the page view, you can browse the Web within OutWit Hub, as you would directly in Firefox or any other browser.

The Hub dissects the page to automatically extract its information and images. Try clicking on the views of the side panel, you will see the content of the page, broken down into its different elements. You can also access the Hub's automation tools.

witscript.views.page.display(); if(userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.toolbar.outwitIcons,1,1,-10); witscript.toolbar.outwitIcons.browse.next10Pages.click(); wizardKit.say(this.parentNode);

2. It's a Web Automator

With its automation features, it browses automatically through series of Web pages and performs extraction tasks for you. It is now browsing through the first result pages of this search.

wizardKit.say(this.parentNode); wizardKit.showLog(100); wizardKit.resize(witscript.logPanel, "height", 30, 3, 10, 2);


The log panel is at the top

All main actions and messages are logged in this panel, which can be shown, hidden or resized at any time by moving the info bar up and down.

witscript.toolbar.outwitIcons.stopAll.click(); if(userSpace.waitOK) witscript.wait(600); //XXXX FIXME: the showCatch function parameter doesn't work for the catch. Using eyeCatcher for now. if (userSpace.eyeCatcherOK) { wizardKit.showCatch(300); wizardKit.eyeCatcher(witscript.catch); } else { wizardKit.showCatch(300); //wizardKit.resize(witscript.catch, "height", 60, 3, 10, 2); }
window.clearInterval(userSpace.messageUpdateTimer);

At the bottom of the screen: the "Catch"

The Catch is your collection basket, where you can store all types of information. Anything of interest can be dragged to the Catch from the page or any other view.

You can hide or show the Catch at will using the view menu, and, when displayed, you can resize it vertically by dragging the horizontal splitter.
In the next pages we will show you how to grab data and export your extractions.

userSpace.updateCatchContentMessage = userSpace.updateCatchContentMessage || function updateCatchContentMessage(){ var theMessage = "There is[are] "+witscript.catch.datasheet.getRowCount()+" element[~s] in your Catch." if (witscript.catch.datasheet.getRowCount() != 0) { $("#catchStatus").html(witscript.agreePlural(theMessage,"en")); $("#catchIsFullMessage").show(); $("#catchIsEmptyMessage").hide(); witscript.catch.datasheet.focus(); witscript.catch.datasheet.selectAll(); } else { // $("#catchRowCount").html("0"); $("#catchIsFullMessage").hide(); $("#catchIsEmptyMessage").show(); } } userSpace.updateCatchContentMessage(); userSpace.messageUpdateTimer = window.setInterval(userSpace.updateCatchContentMessage,3000); wizardKit.say(this.parentNode);
window.clearInterval(userSpace.updateCountsTimer);

Let's Break a Page.

In this wikipedia page, we find the following information objects:

userSpace.updateViewCounts = function(){ //var nbrOfWords = views.words.datasheet.getRowCount(); //XXXXX HTML tags only working in jquery if < and > are encoded? //XXXXX Why are the links in theMessage not working? var theMessage = ""; try{ theMessage = witscript.agreePlural("<li>" + (views.links.datasheet.getRowCount() ? views.links.datasheet.getRowCount() + " link[~s]"+(userSpace.proFeature && views.links.datasheet.getRowCount()==100 ? " (limited in light version)":"")+"</li>" : "Extracting links...</li>"),"en"); theMessage += witscript.agreePlural("<li>" + (views.images.datasheet.getRowCount() ? views.images.datasheet.getRowCount() + " image[~s]</li>" : "Extracting images...</li>"),"en"); if(views.documents.datasheet.getRowCount()){ if(userSpace.waitOK) witscript.wait(500); } theMessage += witscript.agreePlural("<li>" + (views.documents.datasheet.getRowCount() ? views.documents.datasheet.getRowCount() + " document[~s]"+userSpace.proFeature+"</li>" : "Extracting documents"+userSpace.proFeature+"...</li>"),"en"); }catch(e){ alert(e+" Line:"+e.lineNumber+"\n\n"+e.stack); } if(theMessage){ $("#extractionResults").html(theMessage); if(!(/\.\.\./.test(theMessage))){ window.clearInterval(userSpace.updateCountsTimer); //alert(theMessage); //wizardKit.say(document.getElementById("extractionResults"),false,false,true); //wizardKit.say(userSpace.currentNode,":",false,true); if(!(views.words.datasheet.getRowCount() > 1650 && /wikipedia\/Colorado_River.html/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.words.datasheet.sort(0,0); witscript.wait(100); witscript.views.words.execute(); }; } }; } wizardKit.hideCatch(); wizardKit.hideLog(); if(!(/Colorado_River/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.page.load("http://www.outwit.com/support/help/hub/tutorials/work/wikipedia/Colorado_River.html"); } if(userSpace.waitOK) witscript.wait(2000); if(!(views.documents.datasheet.getRowCount() > 3 && /wikipedia\/Colorado_River.html/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.documents.execute(); }; if(!(views.images.datasheet.getRowCount() > 20 && /wikipedia\/Colorado_River.html/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.images.execute(); } witscript.views.page.display(); witscript.menutree.focus(); wizardKit.say(this.parentNode); userSpace.updateCountsTimer = window.setInterval(userSpace.updateViewCounts,1000);
if(userSpace.nbrOfWords){ window.clearInterval(userSpace.updateWordCount); }
    Loading the page...

You can find these elements respectively in the links, images and documents views.

All extracted elements are displayed as a table in the datasheet of their respective view.

They can be exported directly from the view to a file or moved to the Catch, your data collection basket, to be processed or exported at a later time.

// witscript.wait(2000); // views.documents.bottomPanel.reapplyButton.click();
userSpace.updateWordCount = userSpace.updateWordCount || function updateWordCount(){ $("#theTitle").html(theTitle); userSpace.nbrOfWords = views.words.datasheet.getRowCount(); userSpace.pass ++; // alert(nbrOfWords); // dump("pass #"+userSpace.pass+" - "+userSpace.nbrOfWords+" ---- "+(userSpace.nbrOfWords || (userSpace.pass > 10))); if(userSpace.nbrOfWords || (userSpace.pass > 6)){ window.clearInterval(userSpace.updateWordCountTimer); window.clearInterval(userSpace.updateCountsTimer); userSpace.pass = 0; // alert("A"); $("#nbWordsFound").html(witscript.agreePlural("OutWit found "+(userSpace.nbrOfWords>1999?"more than 2000":userSpace.nbrOfWords)+" different word[~s] or recurring group[~s] of words in this page.<span pronunciation='' >"+userSpace.proFeature)+"</span>","en"); // doNotCut is not woking. // wizardKit.say(document.getElementById("nbWordsFound"),false,false,true); } else if(!userSpace.doneWords){ // alert("B"); userSpace.updateWordCountTimer = window.setInterval(userSpace.updateWordCount,1000); if(!(views.words.datasheet.getRowCount() > 1650 && /wikipedia\/Colorado_River.html/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.words.datasheet.sort(0,0) witscript.views.words.execute(); } userSpace.doneWords = true; } } wizardKit.say(this.parentNode); witscript.views.words.datasheet.sort(0,0) var theTitle = "Catching words"+userSpace.proFeature; userSpace.doneWords = false; userSpace.pass = 0; wizardKit.showCatch(200); wizardKit.hideLog(); if(userSpace.waitOK) witscript.wait(2000); witscript.views.words.display(); userSpace.updateWordCount(); witscript.menutree.focus();
if(userSpace.nbrOfWords){ window.clearInterval(userSpace.updateCountsTimer); }

Catching words

OutWit can also grab email addresses, RSS feeds, data, text... We will make tutorials for all these applications.

For now, as a simple example, let's extract some words and groups of words from the current page:

Extracting...

var currentPage = "6.2"; wizardKit.say(this.parentNode); if(userSpace.waitOK) witscript.wait(2000); var i=0; while(currentPage = "6.2" && i < 7){ i++; witscript.views.words.datasheet.sort(1) witscript.wait(1000); } witscript.views.words.datasheet.sort(1,-1) window.clearInterval(userSpace.updateWordCount);
var currentPage = "";

The datasheets of all views as well as the catch behave similarly. You can select rows, right-click on them and apply a variety of functions to them. You can export the selection or the whole datasheet. Clicking on a column header sorts the column (in the most adequate way, depending on the content).

userSpace.updateSelectIfBox = userSpace.updateSelectIfBox || function updateSelectIfBox(doHilite) { witscript.views.words.bottomPanel.selectIf.textBox.setValue($("#selectIfBox").val()); if (doHilite) { if(userSpace.eyeCatcherOK) wizardKit.eyeCatcher(views.words.bottomPanel.selectIf.textBox); } } userSpace.runCatch = userSpace.runCatch || function runCatch(doHilite) { userSpace.updateSelectIfBox(doHilite); witscript.views.words.bottomPanel.selectIf.catchButton.click(); } wizardKit.say(this.parentNode); window.clearInterval(userSpace.updateCountsTimer); witscript.views.words.bottomPanel.selectIf.columnsMenu.setValue("word"); userSpace.updateSelectIfBox(true); witscript.views.words.datasheet.focus();

Let's grab the words and phrases containing:

witscript.views.words.datasheet.sort(0,0) witscript.views.words.display(); wizardKit.say(this.parentNode);

The corresponding selection is highlighted in the datasheet and can be directly exported to a file or sent to the Catch, to be exported later. Click on the Catch button if you want to move these elements to your Catch.

wizardKit.say(this.parentNode); // Just making sure. This is overkill and shoud be enhanced: witscript.menus.tools.resetAllViews.click(); witscript.views.words.datasheet.sort(0,0)


OutWit Hub's Help Center

Each view and editor panel contains a help button.

Click on help for help

It will take you directly to the relevant documentation. You will find there a description of all functions, panels and menu items.

Do not forget to expand the topics and subtopics in the left panel to gain access to the documentation of all features.




Our Quick Tour is Now Over.

witscript.views.page.display(); if(witscript.version("2.1")){$(".owui-wizard-homelink").attr("style","color: #DFFFF9 !important; float:left;").html("More Tutorials")}; userSpace.updateCatchContentMessage2 = userSpace.updateCatchContentMessage2 || function updateCatchContentMessage2(){ if (witscript.catch.datasheet.getRowCount() != 0) { $("#catchIsFullMessage2").show(); $("#catchIsEmptyMessage2").hide(); witscript.catch.datasheet.focus(); witscript.catch.datasheet.selectAll(); } else { $("#catchRowCount").html("0"); $("#catchIsFullMessage2").hide(); $("#catchIsEmptyMessage2").show(); } } userSpace.updateCatchContentMessage2(); userSpace.messageUpdateTimer2 = window.setInterval(userSpace.updateCatchContentMessage2,3000); wizardKit.say(this.parentNode);