Author Topic: RoboB - Robo Browser  (Read 41426 times)

0 Members and 4 Guests are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
RoboB - Robo Browser
« on: July 07, 2012, 06:30:13 PM »
Robo Browser (RoboB for short) allows you to automate a web browser contained within a VoxCommando Window.  The window can be hidden.  There are several ways to manipulate the browser to load, edit, and interact with web pages.  You can "click" on items based on position and sometimes by id etc.  To really use this plugin to create new uses, it will help if you know a bit about html / css / javascript etc.

Robob (alpha version) is included in version 0.953 or later of VoxCommando: http://voxcommando.com/forum/index.php?topic=842.0

The plugin still needs a LOT of work to tap into its full potential and to make it easier to use but I have been testing it to add items to Our Groceries and it is working really well for me.
« Last Edit: July 07, 2012, 06:42:34 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #1 on: July 07, 2012, 06:36:33 PM »
The first sample application of the RoboB plugin that I have created allows us (hopefully) to add items to our grocery list using "Our Groceries".  This is a really great app that allows you to edit and sync your lists among all your different devices.  When all is set up correctly, you will be able to add items to your grocery list any time by tell VC something like: "remember to buy bread" and it will automatically show up on your mobile device which you can take with you to the store.

The first step if you want to try my sample groups is to start using Our Groceries on your PC, mobile, and/or tablet.

Get it here: https://www.ourgroceries.com

Here is a demo / tutorial showing RoboBrowser in action with OurGroceries:


many thanks to Dave for telling us about Our Groceries in this post: https://voxcommando.com/forum/index.php?topic=804.0
and really getting me motivated to start work on the Robo Browser for this application.  It is an idea that I have been mulling over for a long time but this was a great reason to make it happen.

I am attaching the groups here but I will offer more explanation in upcoming posts, and I may even create a youtube tutorial to explain things a bit more.

Of course you can do a lot of other things with RoboB.  I am curious to see what people come up with, and I'll be happy to work with you to improve the plugin in the future.

EDIT: The XML from this post is out of date so I have removed the attachment.

Please see a more up to date version of the commands here: http://voxcommando.com/forum/index.php?topic=843.msg13689#msg13689
« Last Edit: January 02, 2021, 04:22:53 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #2 on: July 07, 2012, 06:50:58 PM »
What you need to do to make this work:

- install or update to VoxCommando version 0.953
- open the VC options form, and enable the RoboB plugin. Save options and restart VC.

- Create an account at http://www.ourgroceries.com
- Play with it.  Get to know it.  Install it on your tab or iPhone etc.  Notice how when you add an item on any computer or device it will show up on other devices that are linked to your account via your email address.  Cool!
- Create a new shopping list to use with VoxCommando

The Following steps require you to use INTERNET EXPLORER on the SAME MACHINE that you will be running VoxCommando on.
The reason is that you will be creating a cookie that keeps you signed in to ourgroceries.  The RoboB plugin uses an Internet Explorer window.  (and before anyone asks... No, it is not possible to use a different browser!  C'est la vie.)
- Open Internet Explorer on the same machine that you will be running VC on.
- go to our groceries.com and click "sign in" at the top right.  If you are already signed in, you can sign out if you need to redo this step
- Important: make sure to place a checkmark where it says "Stay signed in on this computer"
- now enter your email address and password and click Sign-In

You should only need to do all this once, but if you clear your cookies from internet explorer you will probably need to do it again.

- In your browser, click on the grocery list that you created earlier.  If you don't have one then create one that you wan use with VC.
- Copy the URL from your address bar, and keep it handy.  This is the address of your grocery list and we will need to paste it into an LCB action in VoxCommando.  My sample URL looks like this: http://www.ourgroceries.com/your-lists/list/Z862LgsC6pDvBP8v02BLPj

- Import the attached xml into your VC tree using the VC command editor.  You can drag the file into the left side of the editor but be careful to drag it into the empty space below all your groups.  If you drag the file onto an existing group, the commands will be loaded into that group, and we don't want that.  We want the two groups in the file to stay intact, and separate.
« Last Edit: July 07, 2012, 08:48:22 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #3 on: July 07, 2012, 08:13:21 PM »
- Import the attached xml into your VC tree using the VC command editor.  You can drag the file into the left side of the editor but be careful to drag it into the empty space below all your groups.  If you drag the file onto an existing group, the commands will be loaded into that group, and we don't want that.  We want the two groups in the file to stay intact, and separate.

You will see a message that there is a payloadXML file missing.  Don't worry, we will create it later.
« Last Edit: July 07, 2012, 08:44:49 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #4 on: July 07, 2012, 08:50:52 PM »
- Now open the group "robob Our Groceries" and edit the command "open list"
- Paste the URL of your shopping list into the 3rd Action "RoboB.Navigate" as the parameter
(see the image attached)

Note that the window is not shown by default.  If you want to see the window (useful for testing) enable the 4th action"RoboB.Show" by changing the '0' (in red) to a '1'

Also note that this command is always triggered at startup by the event "VC.Loaded" so that it will always be ready to have new items added.  The navigate command should open the window without you having to enter your password, assuming you previously logged in using Internet Explorer and told OurGroceries to keep you logged in.

Save and restart VoxCommando.

Now you can start adding items to your list.
« Last Edit: July 07, 2012, 08:54:38 PM by jitterjames »

hondohc

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: RoboB - Robo Browser
« Reply #5 on: June 11, 2013, 11:33:40 AM »
Hi
Quick question

How do I stop vox and get vox to let me know if I've added the same product to my grocery list all ready on ourgroceries list. ie. If I've added beer twice

Cheers
Darren

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #6 on: June 11, 2013, 11:55:28 AM »
I modified the Add item command as follows:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="646" name="Add Item" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>RoboB.Select</cmdType>
    <cmdString>OurGroceries</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByID</cmdType>
    <cmdString>listDiv</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;{1}</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>You already have {1} on your list</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <cmdString />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.SpeakSync</cmdType>
        <cmdString>Processing</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>RoboB.ElementByID</cmdType>
    <cmdString>importItemsList</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.SetText</cmdType>
    <cmdString>{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementParent</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Submit</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Wait</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>{1}, was added to your list</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>don't forget, remember, I need, We need, remind me</phrase>
  <phrase>to</phrase>
  <phrase>buy, purchase, get, pick up</phrase>
  <phrase optional="true">some, more, some more</phrase>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">groceries.xml</payloadFromXML>
  <phrase optional="true">please</phrase>
</command>

hondohc

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: RoboB - Robo Browser
« Reply #7 on: June 13, 2013, 12:59:53 PM »
Hi James,

Having problem with getting vox to accept this edited file into groups. It's coming up successfully imported into group when i drag .xml file across but the file never actually gets added into group. Any ideas????. Our if you could attach the file so i could just download it, would prefer to fiqure it out myself but have tried everthing that im aware of only started working and looking at code for a few months now so im no expert limited knowledge. Willing to learn doh  :bonk so any help would be great.

Cheers
Darren

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: RoboB - Robo Browser
« Reply #8 on: June 13, 2013, 01:11:32 PM »
Hi James,

Having problem with getting vox to accept this edited file into groups. It's coming up successfully imported into group when i drag .xml file across but the file never actually gets added into group. Any ideas????. Our if you could attach the file so i could just download it, would prefer to fiqure it out myself but have tried everthing that im aware of only started working and looking at code for a few months now so im no expert limited knowledge. Willing to learn doh  :bonk so any help would be great.

Cheers
Darren
Hi Darren, here is the code as a download xml.

I'm not sure, but I think you must rename or delete first your old group before you can drag and drop the code above  ::hmm

[edit 09-Sep-2014: Attachment deleted to avoid confusion. Users should use the updated Our Groceries xml, which James links to at the beginning of this thread. It consists of 2 command groups.]
« Last Edit: September 09, 2014, 09:03:44 AM by nime5ter »
***********  get excited and make things  **********

hondohc

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: RoboB - Robo Browser
« Reply #9 on: June 13, 2013, 02:26:46 PM »
Thanks kalle,

That worked a treat....still would love to know where i went wrong must of been wrong encoding our something.....Anyway thanks for your help IOU 1.

Cheers
Darren ;D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #10 on: June 13, 2013, 06:24:47 PM »
Hi James,

Having problem with getting vox to accept this edited file into groups. It's coming up successfully imported into group when i drag .xml file across but the file never actually gets added into group. Any ideas????. Our if you could attach the file so i could just download it, would prefer to fiqure it out myself but have tried everthing that im aware of only started working and looking at code for a few months now so im no expert limited knowledge. Willing to learn doh  :bonk so any help would be great.

Cheers
Darren

I don't know what XML file you are talking about.  I posted text only, which you can copy and paste into your tree.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #11 on: June 13, 2013, 09:20:06 PM »
Hi Darren, here is the code as a download xml.

I'm not sure, but I think you must rename or delete first your old group before you can drag and drop the code above  ::hmm

It is not necessary as far as the editor is concerned.  It will let you.  But you should not save with two groups that have the same name.  Only the first group will be used.  And you should make sure that you do not have two commands that use the same phrases.

In other words, yes, you should delete the old group, but no, it will not stop you from importing the new group with the same name, or the same commands.

hondohc

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
Re: RoboB - Robo Browser
« Reply #12 on: June 13, 2013, 10:10:37 PM »
I don't know what XML file you are talking about.  I posted text only, which you can copy and paste into your tree.


Thanks james

Thats where I went wrong I copied the text and converted it in notepad plus to .xml. No problem at least I know where I went wrong thanks again for your help.

Cheers
Darren

Bleazle

  • $upporter
  • Contributor
  • *****
  • Posts: 60
  • Karma: 1
    • View Profile
Re: RoboB - Robo Browser
« Reply #13 on: November 08, 2013, 02:54:08 PM »
Hi James

I've added the code you posted above and it's working fine except that if an item has been crossed off the list (for example "eggs") but is still showing in the "crossed off" list VC tells me I already have eggs on my list  :-\ is there any way to restrict the duplicate item check to just the "Shopping List"?

Cheers

Dave
 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: RoboB - Robo Browser
« Reply #14 on: November 08, 2013, 05:59:13 PM »
That one stumped me for a while.

I think the best solution is to use regexReplace to strip out all the html that appears after crossed off by using the pattern:
Code: [Select]
crossed-off-header.*
I don't know if this matches exactly the previous command but it works with my current setup.  It also accounts for the possibility of having multiples of an item in case they accidentally got added more than once.  e.g.: beer (5)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="930" name="Add Item" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>RoboB.Select</cmdType>
    <cmdString>OurGroceries</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByID</cmdType>
    <cmdString>listDiv</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetHTML</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>crossed-off-header.*</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>\s\(\d\)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;&gt;{1}&lt;</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>You already have {1} on your list</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <cmdString />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.SpeakSync</cmdType>
        <cmdString>Processing</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>RoboB.ElementByID</cmdType>
    <cmdString>importItemsList</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.SetText</cmdType>
    <cmdString>{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementParent</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Submit</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Wait</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>{1}, was added to your list</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>don't forget, remember, I need, We need</phrase>
  <phrase>to</phrase>
  <phrase>buy, purchase, get, pick up</phrase>
  <phrase optional="true">some, more, some more</phrase>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">groceries.xml</payloadFromXML>
  <phrase optional="true">please</phrase>
</command>