Author |
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: May 19 2014 at 06:07 | IP Logged
|
|
|
Hi All,
Now for a second thing I need your Help:
on http://www.krommetje.nl/weer/realtime.txt is a page on my webserver which holds my own weatherdata from my own weatherstation. the file realtime.txt is explained here:
http://wiki.sandaysoft.com/a/Realtime.txt
I would like to make a macro which imports these data into PH...
Can you all help me to make a macro which imports these data into PH... later when everything works I am going to post this macro in the Repository.
Peter
Edited by krommetje - May 19 2014 at 06:08
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: May 27 2014 at 15:33 | IP Logged
|
|
|
Peter,
Check out the ph_parseline function. As an example, this code will return the 10th data item for you:
Code:
ph_parseline(ph_parseline(ph_geturl("http://www.krommetje.nl /weer/realtime.txt"),"~r~n~r~n",2)," ",10) |
|
|
*Edit: There is an extra space after .nl before /weer that will need to be removed (stupid board bug).
Dave.
Edited by dhoward - May 27 2014 at 15:35
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: May 28 2014 at 01:28 | IP Logged
|
|
|
Hey that works better then my code , I was already halfway there with the macro using this method:
Storing the realtime.txt in a global TEMPTEST and then using:
Code:
(mid(ph_getglobal_s("TEMPTEST"),50,5))
|
|
|
to filter out the desired values....
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: May 28 2014 at 14:04 | IP Logged
|
|
|
done... the macro is ready.
Dave: is there a way to have the rendered html of an internal page (.psp)
in a cc-window to be transfered to an email sendable by ph?
I would like to have the weatherpage I made in addition to this project
also be mailed on demand or by timed event.....
Peter
Edited by krommetje - May 28 2014 at 14:14
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: July 14 2014 at 07:33 | IP Logged
|
|
|
Bumping Dave:
Dave: is there a way to have the rendered html of an internal page (.psp)
in a cc-window to be transfered to an email sendable by ph?
I would like to have the weatherpage I made in addition to this project
also be mailed on demand or by timed event.....
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: July 14 2014 at 09:31 | IP Logged
|
|
|
Peter,
Not quite sure what you're asking. It sounds as if you've got a Control Center tab that is also able to show a PSP page. If so, Im not sure how thats possible since this feature is on the to-do list .
If you're asking CAN you display HTML/PSP on a Control Center tab, then not yet. I have this planned for when I redo the Control Center.
Now, to save a rendered version of a Control Center tab to an image so that it can be sent in an email, you can use this URL to retrieve the image: http://yourpowerhomeip/ph-cgi/ccimage?id=YOURCCTABID&type=3& keys=0
You should be able to save this to an image so that it can be embedded in an email by using the ph_saveurl function.
Hope this helps,
Dave.
|
Back to Top |
|
|
krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: July 14 2014 at 10:53 | IP Logged
|
|
|
Thanks Dave,
I have to wait for the redo of the Control Center....
I can mail weatherdata but not as an HTML mail rendered with PSP, too bad. What would happen if I open a webcenter page and would like to transfer the webcenterpage to a mail? Or is this the same thing? like ph_wcopen(...)
Like the SMS function I added...
Peter
Edited by krommetje - July 14 2014 at 10:58
|
Back to Top |
|
|