So I have created or modified various AIML to ty things into InMoov, but this one is giving me trouble.

I made all kinds of tests, but everytime I get something that doesn't work.

#####################################

<topic name="GESTURES">
<category>
        <pattern>ROBOT RESEARCH *</pattern>
        <template>
             <random>
               <li>Launching browser </li>
               <li>Searching for you! </li>
               <li>Looking on the net! </li>
            </random><oob>
            <mrl>
          <service>python</service>
          <method>exec</method>
          <param>inmoovsearch()</param>
          <url> "http://www.google.com/search?q=<star/>"</url&gt;
          </mrl></oob>
        </template>
</category></topic>

######################################

This is my inmoovsearch.py file that goes along.

webgui.startService()
def inmoovsearch():
        BareBonesBrowserLaunch.openURL("https://www.google.fr&quot;)

#####################################

I tried to make it all more simple this way, but it doesn't work either:

    <category>
        <pattern>ROBOT RESEARCH *</pattern>
        <template>
             <random>
               <li>Launching browser </li>
               <li>Searching for you! </li>
               <li>Looking on the net! </li>
            </random>
            <system> chrome-browser "http://www.google.com/search?q=<star/>"</system&gt;
        </template>
    </category>

##################################

I am sure there is much more simple ways to do that but...

hairygael

8 years 1 month ago

In reply to by bartcam

Thanks bartcam!

When modifying for google I get a 404 error with:

<topic name="GESTURES">
<category>
        <pattern>ROBOT RESEARCH *</pattern>
        <template>
             <random>
               <li>Launching browser </li>
               <li>Searching for you! </li>
               <li>Looking on the net! </li>
            </random><oob>
            <mrl>
          <service>python</service>
          <method>exec</method>
          <param>BareBonesBrowserLaunch.openURL("https://www.google.fr/results?search_query=<star/>")</param&gt;
          </mrl></oob>
        </template>
</category></topic>

hairygael

8 years 1 month ago

This line is giving me error with the AIML:

newwindow=1&safe=off&site=webhp&source=hp&q

The signs "&" are not okay apparently...??

You are absolutely correct,  & is treated special.

As with in HTML,  & needs to be encoded as &amp;

>  needs to be &gt;

< needs to be &lt;

"  needs to be &quot;   

AIML follows XML syntax.  So if it's valid XML, the AIML should parse correctly.

One way to validate is to rename the AIML file to   ".xml"  and open it in Internet explorer  (or other browser)

It will come up and if the file is valid it should render correctly..  If there is a syntax error, you should see most of th efile, but it will have an error message around where the error occurred in the XML syntax.

 

Here's a good page on XML syntax.  In particular look at the "Entity References" section

http://www.w3schools.com/xml/xml_syntax.asp

 

Hope this helps!

pedro

8 years 1 month ago

python 

 

import webbrowser
def searchGoogle(search):
  search = search.replace(' ', '+')
  webbrowser.open('https://www.google.com/search?gs_ivs=1&q=&#39; + str(search))
  True
  
  
AIML
 
<category><pattern>SEARCH *</pattern><template>.<oob><mrl><service>python</service><method>exec</method><param>searchGoogle("<star/>")</param></mrl></oob></template></category>
<category><pattern>GOOGLE VOICE FOR *</pattern><template>.<oob><mrl><service>python</service><method>exec</method><param>searchGoogle("<star/>")</param></mrl></oob></template></category>
 

 

Great this is finally working!

<topic name="GESTURES">
<category>
        <pattern>ROBOT RESEARCH *</pattern>
        <template>
             <random>
               <li>Launching browser </li>
               <li>Searching for you! </li>
               <li>Looking on the net! </li>
            </random><oob>
            <mrl>
          <service>python</service>
          <method>exec</method>
          <param>BareBonesBrowserLaunch.openURL("https://encrypted.google.com/#q=<star/>&quot;)</param>
          </mrl></oob>
        </template>
</category></topic>