The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Completely pointless example!



--------------090001060706080203070708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


test worked then!

James

Tim Hawes wrote:
> James,
>
> What a cool feature!
> I sent you a couple of test messages over the weekend, did you receive
them?
> The webpage on mi4 said "Failed to Send" or similar, but the
bit of
> text underneath said "this is what just happened" and
described the
> process you list below.
>
> I'm happy to test again if that helps.
>
> Cheers,
>
> Tim.
>
> On 3/3/07, James Traynor <james@xxxxxxx> wrote:
>
>> This is just little example of what could be done with xAP,
Floorplan
>> and a bit of HTML.
>>
>> I have added a form to the homepage of mi4.biz where you can enter
a
>> message for me. When you click send that message appears instantly
on my
>> SLIMP3 above my monitor and this is how it works:
>>
>> This is the html form on the homepage:
>>
>> <form
action="modules.php?name=Messageexample&file=index&func=send"
>> method="post">
>> <input size="20" name="stuff"><input
value="Send" type="submit"></form>
>>
>> This sends the data collected from the input box to a php page on
the
>> same server. That php page receives the data and sends it to my
home via
>> another http request. The reason for doing this rather than just
sending
>> the data straight to my home is that it hides my home IP address,
which
>> is a good thing!
>>
>>
$curl_handle=curl_init('<HomeIP>/custom/On_FromWeb/index.xsp?'.urlencode($stuff));
>> curl_setopt($curl_handle,CURLOPT_PORT,<Floorplan Web Port>);
>> curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);
>> curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,1);
>> curl_setopt($curl_handle, CURLOPT_HEADER, false);
>> $x=curl_exec($curl_handle);
>>
>>
>> On my xAP Floorplan I have made a custom web page to receive the
data
>> and then send the xAP.
>>
>> st=replace(getdata,"+"," ")
>> msg=replace(st,"\'","'")
>> if msg<>"" then
>>    'send the message.display message
>>    body="display.text" & chr(10)
>>    body=body & "{" & chr(10)
>>    body=body & "Line1=Message from the web" &
chr(10)
>>    body=body & "Line2=" & msg & chr(10)
>>    body=body & "Priority=3" & chr(10)
>>    body=body & "Duration=20" & chr(10)
>>    body=body & "}" & chr(10)
>>   
x=xap.sendxap(body,"message.display","ersp.slim.server:monitor")
>> end if
>>
>>
>> Hopefully it gives a little taster of what can be done and how
easy it
>> would be to extend this to send other messages and do other
functions.
>>
>> So next time you're on mi4 you can say hi!
>>
>> Cheers
>>
>> James
>>
>>
>>
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>


--------------090001060706080203070708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">


<br>
test worked then!<br>
<br>
James<br>
<br>
Tim Hawes wrote:
<blockquote
cite="mid:2829695e0703050143y4f855aaai66182b236dee84c4@xxxxxxx"
type="cite">
<pre wrap="">James,

What a cool feature!
I sent you a couple of test messages over the weekend, did you receive
them?
The webpage on mi4 said "Failed to Send" or similar, but the bit
of
text underneath said "this is what just happened" and described
the
process you list below.

I'm happy to test again if that helps.

Cheers,

Tim.

On 3/3/07, James Traynor <a class="moz-txt-link-rfc2396E"
href="mailto:james@xxxxxxx";>&lt;james@xxxxxxx&gt;</a>
wrote:
</pre>
<blockquote type="cite">
<pre wrap="">This is just little example of what could be
done with xAP, Floorplan
and a bit of HTML.

I have added a form to the homepage of mi4.biz where you can enter a
message for me. When you click send that message appears instantly on my
SLIMP3 above my monitor and this is how it works:

This is the html form on the homepage:

&lt;form
action="modules.php?name=Messageexample&amp;file=index&amp;func=send"
method="post"&gt;
&lt;input size="20"
name="stuff"&gt;&lt;input value="Send"
type="submit"&gt;&lt;/form&gt;

This sends the data collected from the input box to a php page on the
same server. That php page receives the data and sends it to my home via
another http request. The reason for doing this rather than just sending
the data straight to my home is that it hides my home IP address, which
is a good thing!

$curl_handle=curl_init('&lt;HomeIP&gt;/custom/On_FromWeb/index.xsp?'.urlencode($stuff));
curl_setopt($curl_handle,CURLOPT_PORT,&lt;Floorplan Web Port&gt;);
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle, CURLOPT_HEADER, false);
$x=curl_exec($curl_handle);


On my xAP Floorplan I have made a custom web page to receive the data
and then send the xAP.

st=replace(getdata,"+"," ")
msg=replace(st,"\'","'")
if msg&lt;&gt;"" then
'send the message.display message
body="display.text" &amp; chr(10)
body=body &amp; "{" &amp; chr(10)
body=body &amp; "Line1=Message from the web" &amp;
chr(10)
body=body &amp; "Line2=" &amp; msg &amp; chr(10)
body=body &amp; "Priority=3" &amp; chr(10)
body=body &amp; "Duration=20" &amp; chr(10)
body=body &amp; "}" &amp; chr(10)
x=xap.sendxap(body,"message.display","ersp.slim.server:monitor")
end if


Hopefully it gives a little taster of what can be done and how easy it
would be to extend this to send other messages and do other functions.

So next time you're on mi4 you can say hi!

Cheers

James









xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.