Hi Henry,
For this purpose it is suggested that your sms-service be setup as follows:

group = sms-service
keyword = default
url = "http://localhost/cgi-bin/RSS_RequestProcess.php?keyword=%k&phrase=%r";

See kannel user guide pg 102 for the full escape codes listing. In this way you can have full control over what the Kannel sends in response to an sms request. Within the file RSS_RequestProcess.php, you will read the POST variables keyword and phrase and format the URL nicely to be submitted to Google; i.e.

$keyword = $_POST['keyword'];
$phrase = $_POST['phrase'];

if ($keyword == 'Search')
{
$url = "http://www.google.com.sg/search?hl=en&q=$phrase&btnG=Google+Search&meta=";;

   // submit to google
   // get results for $phrase
   // convert to sms format
   // submit via POST to kannel sendsms
}

It should be a relatively trivial programming exercise. :)

Henry Junior wrote:
Goal: To use a keyword to trigger an action and use the 2nd word in the message to be used in an actual search.

I want to use kannel so that whenever I send a message like:
Search SomePhrase

I get the google results of SomePhrase

----------------------------------------
In my .conf I have this setup:
----------------------------------------
# SMS SERVICE DO A SEARCH EXAMPLE
group = sms-service
keyword = Search
get-url = "http://www.google.com/xhtml?q=%s";

----------------------------------------
I also have this defined in my .conf:
----------------------------------------
group = sms-service
keyword = default
text = "This is an automated reply"

----------------------------------------
Currently what ends up happening
----------------------------------------
If I send a message:
Seach SomePhrase

I am returned:
This is an automated reply.

I don't understand why this is happening.

I've replaced q=%s with q=%p and simply sent the message:
Search

I am returned the results of a google search with the Phone number of the sending device.

Your help is greatly appreciated!

-HJ


--This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Reply via email to