WIZ-IMAGES01.ALT

This is an OutWit Tutorial file.


Testing Browser...
OutWit Hub - Image Extraction
Application walkthrough: collecting images.
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-7]/i.test(navigator.userAgent)); 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")){$(".owui-wizard-homelink").html("Hub Tutorials")}; userSpace.storeOriginalPrefs(); userSpace.setWizardPrefs(); witscript.logPanel.setAttribute("height",0);
wizardKit.say(this.parentNode);


This tutorial is going to
show you how to grab
images with OutWit Hub.


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

wizardKit.say(this.parentNode); if(!witscript.version("2.1")){ witscript.wait(500); var top = wizard.getPosition().top; var left = wizard.getPosition().left; var bottom = wizard.getPosition().bottom; 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 panel around on the screen to see the parts of the interface that you want.

wizardKit.hideCatch(); wizardKit.hideLog(); var sampleSearches = ["bird", "ballet_dancing", "beauty", "grand_canyon", "solar_system", "Tropical_island#Tropical_islands", "vermeer", "aurora_borealis", "sunset", "taj_mahal", "eiffel_tower", "paris", "rainforest", "autumn", "volcano"]; var search = sampleSearches[Math.round(Math.random()*(sampleSearches.length-1))]; var url = "http://en.wikipedia.org/wiki/"+search witscript.views.page.load(url); witscript.views.page.display(); wizardKit.say(this.parentNode);

Among other things,
Outwit Hub is a Web Browser

In the page view, you can surf the Web within the Hub. When looking for images, you can simply go to the galleries you like, explore public and free sources of data and media as you would directly in Firefox or any other browser. (Make sure to read and respect copyright notices.)

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

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. When looking for images, OutWit explores the links, in search for the highest possible resolution for each image found in the page.

window.clearInterval(userSpace.updateCountsTimer);

Grabbing Images

For our example, let's use this wikipedia page.
OutWit is searching the page for images....

wizardKit.hideCatch(); wizardKit.hideLog(); userSpace.updateViewCounts = function(){ if(witscript.views.images.datasheet.getRowCount()){ witscript.wait(500); } var theMessage = ""; try { theMessage = witscript.agreePlural((witscript.views.images.datasheet.getRowCount() ? "found " + witscript.views.images.datasheet.getRowCount() + " image[~s]" : "is extracting images..."),"en"); } catch(e) { alert(e+" Line:"+e.lineNumber+"\n\n"+e.stack); } if (theMessage) { $("#extractionResults").html(theMessage); if (!(/\.\.\./.test(theMessage))) { window.clearInterval(userSpace.updateCountsTimer); wizardKit.say(userSpace.currentNode); } }; } userSpace.currentNode = this.parentNode; userSpace.updateCountsTimer = window.setInterval(userSpace.updateViewCounts,1000); //witscript.error(witscript.views.images.datasheet.getRowCount() + " " + witscript.toolbar.urlBar.getValue()); if (!(witscript.views.images.datasheet.getRowCount() > 15) || !(/wiki/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.page.load("http://en.wikipedia.org/wiki/Aurora_(astronomy)"); witscript.wait(1000); witscript.views.images.execute(); } witscript.views.page.display(); witscript.menutree.focus();
wizardKit.say(this.parentNode); if (!witscript.views.images.bottomPanel.options.style.getValue()){ witscript.views.images.bottomPanel.options.style.setValue("true"); } witscript.views.images.datasheet.sort(0,0) witscript.views.images.display(); witscript.menutree.focus(); if(!(witscript.views.images.datasheet.getRowCount() > 15 || !(/wiki/.test(witscript.toolbar.urlBar.getValue())))){ witscript.views.page.load("http://en.wikipedia.org/wiki/Aurora_(astronomy)"); witscript.wait(1000); witscript.views.images.execute(); } wizardKit.showCatch();

They appear in the 'images' view.
They can be downloaded directly from the view using the right-click menu or moved to the Catch, your collection basket, to be used at a later time.

wizardKit.say(this.parentNode); userSpace.updateSelectIfBox = userSpace.updateSelectIfBox || function updateSelectIfBox(doHilite) { // witscript.views.images.bottomPanel.selectIf.columnsMenu.size.click() witscript.views.images.bottomPanel.selectIf.columnsMenu.setValue("size"); //witscript.views.images.bottomPanel.selectIf.conditionsMenu.greaterOrEqualTo.click() witscript.views.images.bottomPanel.selectIf.conditionsMenu.setValue("greaterOrEqualTo"); witscript.views.images.bottomPanel.selectIf.textBox.setValue($("#selectIfBox1").val()); if (doHilite) { witscript.views.images.bottomPanel.selectIf.textBox.hilight(); } } userSpace.runCatch = userSpace.runCatch || function runCatch(doHilite) { userSpace.updateSelectIfBox(doHilite); witscript.views.images.bottomPanel.selectIf.catchButton.click(); } if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf.conditionsMenu); wizardKit.showCatch(); window.clearInterval(userSpace.updateCountsTimer); userSpace.updateSelectIfBox(false, true); witscript.views.images.datasheet.focus();

You can select the images you want by setting a criterion in the bottom panel.
Set the column on which the test must be performed, the type of condition and the criterion:

witscript.views.images.display(); wizardKit.say(this.parentNode); witscript.wait(1000); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf.catchButton); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf.catchButton); userSpace.updateSelectIfBox(false, true);

The corresponding selection is highlighted in the datasheet. By clicking on the Catch button, you can move the selection to the Catch.

wizardKit.hideCatch();

Highest Resolution

witscript.views.images.datasheet.sort(0,0) wizardKit.say(this.parentNode); if(!(witscript.views.images.datasheet.getRowCount() > 15) || !(/wiki/.test(witscript.toolbar.urlBar.getValue()))){ witscript.views.page.load("http://en.wikipedia.org/wiki/Aurora_(astronomy)"); witscript.wait(1000); witscript.views.images.execute(); } witscript.views.images.display(); witscript.menutree.focus();

These images are not the low resolution photos that appear in the page, they are the corresponding high res images which have been located by the application. At this point, we may want to have a closer look to see their quality...

window.clearInterval(userSpace.updateCountsTimer); userSpace.updateSelectIfBox2 = userSpace.updateSelectIfBox2 || function updateSelectIfBox2(doHilite) { // witscript.views.images.bottomPanel.selectIf.columnsMenu.filename.click() witscript.views.images.bottomPanel.selectIf.columnsMenu.setValue("filename"); // witscript.views.images.bottomPanel.selectIf.conditionsMenu.notEndWith.click() witscript.views.images.bottomPanel.selectIf.conditionsMenu.setValue("notEndWith"); witscript.views.images.bottomPanel.selectIf.textBox.setValue($("#selectIfBox2").val()); } wizardKit.hideCatch(); wizardKit.hideLog(); witscript.wait(1000); wizardKit.say(this.parentNode); witscript.views.images.bottomPanel.selectIf.columnsMenu.setValue("filename"); userSpace.updateSelectIfBox2(false, true); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf.conditionsMenu); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.views.images.bottomPanel.selectIf.conditionsMenu); witscript.views.images.datasheet.focus();

We will now watch ourselves a little slide show.
First, let's select the images that we do not want to keep
(say the ones that are not jpeg files):

witscript.views.images.display(); wizardKit.say(this.parentNode); userSpace.updateSelectIfBox2(false, true);

The selection is highlighted. By hitting the backspace/delete key on your keyboard, you can remove these images from the list.

wizardKit.stopSlideShow(); wizardKit.say(this.parentNode); witscript.views.images.datasheet.deleteSelectedRows(); if (witscript.views.images.bottomPanel.options.style.getValue()){ witscript.views.images.bottomPanel.options.style.setValue("false"); }

 

wizardKit.stopSlideShow(); window.clearInterval(userSpace.updateFocusTimer); wizardKit.say(this.parentNode); witscript.toolbar.outwitIcons.stopAll.click(); witscript.wait(500); witscript.views.images.display(); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.toolbar.outwitIcons); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.toolbar.outwitIcons.slideshow); if (userSpace.eyeCatcherOK) wizardKit.eyeCatcher(witscript.toolbar.outwitIcons.slideshow);

Playing the slide show

In any page you visit, pressing the slide show button in the toolbar will run the full screen slide show with the high resolution images found. (You can set the minimum resolution to use in the preferences.)

wizardKit.say(this.parentNode); userSpace.top = wizard.getPosition().top; userSpace.left = wizard.getPosition().left; witscript.toolbar.outwitIcons.slideshow.click(); userSpace.updateFocus = userSpace.updateFocus || function (){ var top = wizard.getPosition().top; var left = wizard.getPosition().left; if((top != userSpace.top || left != userSpace.left ) && witscript.menus.view.slideShow.getAttribute("checked")=="true"){ witscript.views.page.slideshow.focus(); userSpace.top = wizard.getPosition().top; userSpace.left = wizard.getPosition().left; } } userSpace.updateFocusTimer = window.setInterval(userSpace.updateFocus,500);
window.clearInterval(userSpace.updateFocusTimer);

While playing the slide show, you can use the up and down arrows to set the speed, the space bar to pause the show and the left and right arrows to move to the next/previous image.

To exit the presentation, just press the escape key.

wizardKit.stopSlideShow(); window.clearInterval(userSpace.updateFocusTimer); wizardKit.say(this.parentNode); witscript.toolbar.outwitIcons.stopAll.click();


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.




Congratulations:
Free public sources
of content are now yours.

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);