RoboSuite Open Kapow Quick Start Guide

48
RoboSuite 6.2 openkapow Quick Start Guide

Transcript of RoboSuite Open Kapow Quick Start Guide

Page 1: RoboSuite Open Kapow Quick Start Guide

Robo

Suite

6.2

openkapow Quick Start Guide

Page 2: RoboSuite Open Kapow Quick Start Guide
Page 3: RoboSuite Open Kapow Quick Start Guide

openkapow Quick Start Guide

© 1999-2007 Kapow Technologies Version: 6.2

Page 4: RoboSuite Open Kapow Quick Start Guide

Copyright 1999-2007 Kapow Technologieshttp://www.kapowtech.com All rights reserved.

Page 5: RoboSuite Open Kapow Quick Start Guide

CONTENTS iii

Contents

WELCOME!.............................................................................................. 1 Legal Notice.......................................................................................1

CREATE AN RSS FEED................................................................................ 2 Step 1 – Start RoboMaker ....................................................................2 Step 2 – Create New RSS Robot............................................................2 Step 3 – Enter URL to Start From..........................................................3 Step 4 – Enter Name and Description ....................................................4 Step 5 – Complete the Wizard ..............................................................5 Step 6 – Choose Videos Tab .................................................................5 Step 7 – Choose Science & Technology ..................................................7 Step 8 - Loop over Videos ....................................................................8 Step 9 – Extract Title ........................................................................ 10 Step 10 – Extract URL ....................................................................... 11 Step 11 – Extract Description ............................................................. 12 Step 12 – Try your Robot in the Debugger............................................ 12 Step 13 – Publish the RSS Feed .......................................................... 13 Step 13 – Use Your RSS Feed ............................................................. 14

CREATING A REST WEB SERVICE............................................................... 16 Step 1 – Start RoboMaker .................................................................. 16 Step 2 – Create a New REST Robot ..................................................... 17 Step 3 – Enter URL to Start From........................................................ 18 Step 4 – Select Input Values .............................................................. 19 Step 5 – Select Output Values ............................................................ 21 Step 6 – Enter Word ......................................................................... 22 Step 7 – Select Translation Option ...................................................... 23 Step 8 – Click Translate..................................................................... 25 Step 9 - Extract the Translation .......................................................... 26 Step 10 – Publish the Web Service ...................................................... 27 Step 11 – Try out the Robot ............................................................... 28

CREATING A WEB CLIP ............................................................................ 30 Step 1 – Start RoboMaker .................................................................. 30 Step 2 – Create a New Web Clipping Robot........................................... 31 Step 3 – Enter Start URL ................................................................... 32 Step 4 – Call the Bluff ....................................................................... 33 Step 5 – Add a New Clip Branch.......................................................... 33 Step 6 – Select clip in Call Bluff branch ................................................ 34 Step 7 – Select clip in Default branch .................................................. 37

Page 6: RoboSuite Open Kapow Quick Start Guide

iv ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 8 – Publish the robot.................................................................. 39 CONCLUSION ......................................................................................... 41 INDEX.................................................................................................. 42

Page 7: RoboSuite Open Kapow Quick Start Guide

WELCOME! 1

Welcome! Welcome to openkapow RoboMaker. This quick start guide will help you getting started writing and publishing robots on openkapow.

The RoboMaker application allows you to create, edit and debug robots. RoboMaker comes with an extensive online help system, and a comprehensive user manual.

Legal Notice In this guide, we refer to the trademarks YouTube, blufr and altavista. This is nominative use and is not indented as an infringement on the rights of the trademark owner.

Page 8: RoboSuite Open Kapow Quick Start Guide

2 ROBOSUITE OPENKAPOW QUICK START GUIDE

Create an RSS Feed The first robot we create will be an RSS robot that lists the 20 most popular Science & Technology clips on YouTube.

Step 1 – Start RoboMaker First, start up RoboMaker. You can do this from the Start Menu.

Step 2 – Create New RSS Robot RoboMaker presents a welcome screen that allows you to select the type of robot to create. Select Create an RSS feed.

Figure 1: RoboMaker Startup Wizard

Page 9: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 3

Step 3 – Enter URL to Start From We will start from the http://www.youtube.com page. Enter www.youtube.com in the text field.

Figure 2: Enter start URL

Click Next or press Enter to continue.

Page 10: RoboSuite Open Kapow Quick Start Guide

4 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 4 – Enter Name and Description Next, we will choose a name and description for your RSS feed. The wizard suggests a name based on the URL you just entered, but in this case we'll choose another name. Enter Science clips in the Name field, and a short description in the Description field, e.g. The most viewed science clips on YouTube. The description is optional.

Figure 3: Enter Name and Description

Click Next to continue.

Page 11: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 5

Step 5 – Complete the Wizard The wizard will then ask you whether you want your RSS feed to take input from the user of the feed. We won't do that for this simple wizard.

Figure 4: Finish the Wizard

Select No and click Finish.

This will complete the wizard and create your robot. The newly created robot will immediately load the start URL you entered (www.youtube.com).

Step 6 – Choose Videos Tab First of all, a short introduction is in order. What you will notice first is the browser-like view in the lower-left corner. That is the Page View. It displays the current page of the robot. The two boxes above are Steps. They define

Page 12: RoboSuite Open Kapow Quick Start Guide

6 ROBOSUITE OPENKAPOW QUICK START GUIDE

your robots interaction with the page. Currently there are only two Steps, so the robot does little more than load the home page of YouTube.

First, we want the robot to click on the Videos tab on the page. Right-click on the Videos link and select Click from the right-click menu.

Figure 5: Click on the Videos Tab

This will insert a new Click Step that performs the click.

Page 13: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 7

Step 7 – Choose Science & Technology Now configure the robot to click on the Science & Technology category in the left part of the page.

Figure 6: Choose Science & Technology

Right-click on the Science & Technology link and select Click in the right-click menu. After performing the step, the robot then shows today's most views in the Science & Technology category.

Page 14: RoboSuite Open Kapow Quick Start Guide

8 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 8 - Loop over Videos Now right-click on a free space inside the Most Viewed table, and choose Loops | For Each Tag Path in the right-click menu.

Figure 7: Right-click in the Most Viewed Table

Page 15: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 9

Then configure the action by entering td in the Tag Path property.

Figure 8: Enter Tag Path

This will loop over all <td> tags in the table.

Insert a new step after this one, by clicking on the icon in the toolbar.

Figure 9: Insert Step after Select Step

Page 16: RoboSuite Open Kapow Quick Start Guide

10 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 9 – Extract Title You will notice a blue bounding box in the Page View. This is shown to indicate the part of the page we are currently iterating over.

To extract the news item title, right-click on the link to the video and choose Extract Title in the right-click menu.

Figure 10: Extract Title

Page 17: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 11

Step 10 – Extract URL Right-click again and select Extract URL to extract the URL for the item.

Figure 11: Extract URL

Page 18: RoboSuite Open Kapow Quick Start Guide

12 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 11 – Extract Description The last information to extract is a description for the news item. Select the text below the video to get the description. Notice that it is a little tricky to select the entire text by click in the page view. Just below the browser view is the source for the page, which you can click in more easily in this case. Right-click on the div tag and choose Extract Description.

Figure 12: Extract Description

Step 12 – Try your Robot in the Debugger Your robot is now done. Now let's take it for a test-run before we publish it. Click on Open Debugger ( ) to start RoboDebugger and click Run ( ) in the debugger window.

Page 19: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 13

The results are shown below in the Input/Outputs tab. See the example result below:

Figure 13: RoboDebugger Results

Step 13 – Publish the RSS Feed Your service is now done and we have verified it works. Once you deploy the service, the data will be available will be available as an RSS feed.

Since this may be the first time you publish to openkapow from RoboMaker, you will have to enter your username and password for the openkapow site. Choose File | Edit Username and Password ( ).

Figure 14: Enter Username and Password

Page 20: RoboSuite Open Kapow Quick Start Guide

14 ROBOSUITE OPENKAPOW QUICK START GUIDE

You can click on the underlined links to register, if you have not done so already, or to retrieve your lost password.

Click on Publish to openkapow ( ) to publish the robot. If you have not entered your username and password yet, the dialog for entering the username and credentials will appear now (see Figure 14 above). If your user credentials are valid, the dialog below will appear instead.

Figure 15: Publish on openkapow

Enter a title and a category for your robot to be placed under on openkapow. You can also enter a description and one or more tags that other users can use when searching for your service.

Step 13 – Use Your RSS Feed Using the created RSS feed is straightforward. Copy the robot service URL, and enter it into your favorite RSS news reader. You can also access the URL

Page 21: RoboSuite Open Kapow Quick Start Guide

CREATE AN RSS FEED 15

for the RSS feed directly. Most browsers will render the feed reasonable well, even though it is not HTML.

openkapow will take care to run your robot at regularly scheduled intervals to update the contents of the feed.

Page 22: RoboSuite Open Kapow Quick Start Guide

16 ROBOSUITE OPENKAPOW QUICK START GUIDE

Creating a REST Web Service This chapter will help you create your first REST web service. REST-style web services are a lightweight alternative to SOAP-style web services under some circumstances.

Step 1 – Start RoboMaker This is for the benefit of those who have jumped into the quick start guide at this point. Of course, if RoboMaker is already running, skip this step.

RoboMaker can be started from the Start Menu.

Page 23: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 17

Step 2 – Create a New REST Robot Choose to create a new REST robot. If you have just started RoboMaker, you can do that from the startup wizard (see Figure 1 above). Otherwise, you can choose New ( ) to start the following wizard:

Figure 16: New REST Robot

Click Next or press Enter to continue.

Page 24: RoboSuite Open Kapow Quick Start Guide

18 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 3 – Enter URL to Start From We will start from the http://babelfish.altavista.com page. Enter babelfish.altavista.com in the text field.

Figure 17: Enter Start URL

Click Next or press Enter to continue.

Page 25: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 19

Step 4 – Select Input Values Select the input values the robot takes. This robot takes only one input value: The word to translate. Enter word then press Enter.

Figure 18: Enter Input Values

Page 26: RoboSuite Open Kapow Quick Start Guide

20 ROBOSUITE OPENKAPOW QUICK START GUIDE

Click Next or press Enter to continue to the next page. On this page you can fill out the input values. Enter fish for the word input value.

Figure 19: Fill in Value

Click Next or press Enter to continue.

Page 27: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 21

Step 5 – Select Output Values The robot should return a translation of the word that was provided as input. Enter translation, and press Enter.

Figure 20: Enter Output Values

Click Finish or press Enter to create the robot.

Page 28: RoboSuite Open Kapow Quick Start Guide

22 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 6 – Enter Word Now the robot has been created, but it is still not configured to handle the translation. After loading the Babelfish page, the first thing the robot should to is to enter the word into the text field that contains the word to translate.

Right-click on the text field with the caption "Translate a block of text" and select Enter Text from Attribute | RESTInput | RESTInput.value1 (word) from the right-click menu.

Figure 21: Enter Word

Notice how the word fish has been entered into the text field.

Page 29: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 23

Step 7 – Select Translation Option Then select to translate from English to German. Right-click on the selection box with the text "Select to and from language", and choose Select Option in the right-click menu.

Figure 22: Select Option

Page 30: RoboSuite Open Kapow Quick Start Guide

24 ROBOSUITE OPENKAPOW QUICK START GUIDE

After doing this, a dialog will appear. Select "English to German" in the drop-down box.

Figure 23: Select Option Dialog

After this step, the translation option has been set to translate from English to German. As you may have noticed, it is actually possible to set the value dynamically, instead of hard-coding it into the robot as we did here. It is possible to let the user determine what language to translate from and to, by specifying it as input values.

Page 31: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 25

Step 8 – Click Translate Make the robot click on the Translate button, by right-clicking on it and selecting Click on the right-click menu.

Figure 24: Click Translate

Clicking on translate makes the site translate the word from German to English.

Page 32: RoboSuite Open Kapow Quick Start Guide

26 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 9 - Extract the Translation To complete the robot, we must now extract the translation from the page. Do this by right-clicking on the text box containing the translation and selecting Extract | Extract Text | RESTOutput | RESTOutput.value1 (translation).

Figure 25: Extract Translated Word

This places the translated word in the output value translation, which is returned to the caller.

Page 33: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 27

Step 10 – Publish the Web Service The robot is now complete. Click on Publish to openkapow ( ) to publish the robot. If you have not entered your username and password yet, the dialog for entering the username and credentials will appear now (see Figure 14 above). If your user credentials are valid, the dialog above will appear instead.

Figure 26: Publish REST Robot

Page 34: RoboSuite Open Kapow Quick Start Guide

28 ROBOSUITE OPENKAPOW QUICK START GUIDE

After you have successfully published the robot, the following dialog will appear:

Figure 27: REST Robot Published

Click on the link to try out the web service.

Step 11 – Try out the Robot The URL to the newly created web service can now be used to translate words from English into German. The word to translate is provided as a parameter to the URL, like this: http://service.openkapow.com/Translatetogerman.rest?word=road. If you just the URL without any parameters you will get an HTML page where you can provide the word parameter.

Figure 28: Web Service Test Page

Page 35: RoboSuite Open Kapow Quick Start Guide

CREATING A REST WEB SERVICE 29

Enter a value (e.g. road) and click Invoke Service. The robot will take the input parameter, load the Babelfish page, fill out values, choose the language option, click on the translate button and extract the translation. It will then return the result as XML, which will be rendered like this in a browser:

Figure 29: Web Service Result XML

The REST service can format the output in several ways. The XML format is the default, but it can also return HTML, CSV text, and JSON. Every created service can return each of these output formats, depending on how it is invoked. More output formats will be added later, expanding the applicability of existing services.

Page 36: RoboSuite Open Kapow Quick Start Guide

30 ROBOSUITE OPENKAPOW QUICK START GUIDE

Creating a Web Clip This chapter will help you create your first web clipping robot, a clip from the Blufr service.

Step 1 – Start RoboMaker This is for the benefit of those who have jumped into the quick start guide at this point. Of course, if RoboMaker is already running, skip this step.

RoboMaker can be started from the Start Menu.

Page 37: RoboSuite Open Kapow Quick Start Guide

CREATING A WEB CLIP 31

Step 2 – Create a New Web Clipping Robot Choose to create a new REST robot. If you have just started RoboMaker, you can do that from the startup wizard (see Figure 1 above). Otherwise, you can choose New ( ) to start the following wizard:

Figure 30: New web clipping robot

Select “Create a new web clip” and click Next or press Enter to continue.

Page 38: RoboSuite Open Kapow Quick Start Guide

32 ROBOSUITE OPENKAPOW QUICK START GUIDE

Step 3 – Enter Start URL Now you should see a wizard that looks like this:

Figure 31: Enter Start URL

Enter www.blufr.com in the text field and click Finish.

Page 39: RoboSuite Open Kapow Quick Start Guide

CREATING A WEB CLIP 33

Step 4 – Call the Bluff RoboMaker will now open a view of the deployed clip, called the Portlet View. In the Portlet View, click on either the “Way” or “No Way” button call the bluff. The robot will then perform the user interaction.

Figure 32: Call the bluff in the Portlet View

After calling the bluff the page will contain the following:

Figure 33: Bluffed!

Step 5 – Add a New Clip Branch Now we will add a new Clip Branch to handle the results page differently than the initial page. Click on Add Clip Branch ( ) in the toolbar.

Figure 34: Add Clip Branch

Page 40: RoboSuite Open Kapow Quick Start Guide

34 ROBOSUITE OPENKAPOW QUICK START GUIDE

This will trigger a new dialog window, where you can name the Clip Branch. Name it Call Bluff, and press Finish.

Figure 35: Name the new clip branch

This will add a few additional steps to the robot.

Step 6 – Select clip in Call Bluff branch Instead of clipping the entire page, we will now select only part of the page to clip. To configure the step, click on the Clip step in the Call Bluff branch.

Figure 36: Go to Clip step in Call Bluff branch

Page 41: RoboSuite Open Kapow Quick Start Guide

CREATING A WEB CLIP 35

Use the mouse and the arrows in the toolbar to select the part of the page to clip. The selection is shown with red dashed lines. Continue until you have selected the parts shown below.

Figure 37: Select part to clip

After selecting, go to the End Clip Step in the same branch.

Figure 38: Go to End Clip step in Call Bluff branch

Page 42: RoboSuite Open Kapow Quick Start Guide

36 ROBOSUITE OPENKAPOW QUICK START GUIDE

When this is done, the Portlet View gets focus again, and shows a preview of the clip:

Figure 39: The selected clip

Page 43: RoboSuite Open Kapow Quick Start Guide

CREATING A WEB CLIP 37

Step 7 – Select clip in Default branch

First, click on the Restart Session ( ). This will cause the robot to navigate to the start page. Then select the Clip step in the default branch:

Figure 40: Go to Clip step in Default branch

Then select what to clip in the page view in the lower-left corner. Select items until you have this:

Figure 41: Select items in th the Default branch

Page 44: RoboSuite Open Kapow Quick Start Guide

38 ROBOSUITE OPENKAPOW QUICK START GUIDE

Click on the End Clip step in the same branch to show how the interactive clip will look:

Figure 42: The selected clip

Page 45: RoboSuite Open Kapow Quick Start Guide

CREATING A WEB CLIP 39

Step 8 – Publish the robot Now the robot is finished, it is time to publish it to openkapow. Click on Publish to openkapow ( ) to publish the robot. If you have not entered your username and password yet, the dialog for entering the username and credentials will appear now (see Figure 14 above). If your user credentials are valid, the dialog below will appear instead.

Figure 43: Publish dialog

Fill out the dialog. Start by entering a title. The URL will contain your username and a short string derived from the title. You must also choose a category. When you are ready, publish the robot to openkapow.

Page 46: RoboSuite Open Kapow Quick Start Guide

40 ROBOSUITE OPENKAPOW QUICK START GUIDE

After the robot has been uploaded, the following dialog will be displayed:

Figure 44: Published dialog

Page 47: RoboSuite Open Kapow Quick Start Guide

CONCLUSION 41

Conclusion You can get more information on the openkapow site, at http://www.openkapow.com. You can also read the RoboMaker User's Guide that is included in the RoboMaker installation.

Page 48: RoboSuite Open Kapow Quick Start Guide

42 ROBOSUITE OPENKAPOW QUICK START GUIDE

Index

P password, 14

publishing robots, 13, 15

R RoboDebugger, 12

starting, 12

RoboMaker, 1

starting, 2, 17, 31

rss robot, 2

U username, 14