Refreshing URL Header Info

Posted on
Tue Jan 13, 2015 8:12 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Refreshing URL Header Info

Hi

Interested in what the Control Page refreshing URL is expecting to be returned.

Basically using github/pyicloud to run a python script on seperate webserver to grab latitude/latitude details from icloud. This script then generates a google maps static map with the longitude/lantitude details included - such as

https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284

from

[url]
https://developers.google.com/maps/docu ... taticmaps/[/url]

If I put the above refreshing url into a control page it works well! (yah - proof of concept)

If I put a php page that runs the python script, generates the url and via header:Location with php to the returned url - this does not work from within a control page.

Basically the direct link works, but putting the php page (which redirects to the link via header: Location) does not.

I get a unknown url error returned. (sorry will post exact error when can/back)

I suspect there is some header information which is wanted by the control page which I am not returning. Also the icloud logon/lookup takes around 7 seconds or so - could it be a timeout issue?

Is does seem it is possible to redirect to a image file - as http://forums.indigodomo.com/viewtopic.php?f=83&t=11166 shown here - will try saving to file and let redirect to file report back.

Any suggestions - many thanks

Glenn

Posted on
Tue Jan 13, 2015 8:45 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Refreshing URL Header Info

One option that might give you more control would be to create a schedule or other method to copy the image down to the local computer; the control page would then point to the local image which is being refreshed by a script/schedule/plugin/whatever. I do that with some security images -- I have a plugin that I created that downloads/saves the images (a set in my case, but could just be one for you) to the local disk. The control pages point to a file:// url on the local server to retrieve it and serve to the clients.

Adam

Posted on
Tue Jan 13, 2015 11:52 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Refreshing URL Header Info

Thanks

I think the file issue - is the files are not on the local/Indigo server - they are on a seperate windows webserver.

Accessing them through file://servername/where/file/is - is proving problematic.

Hmmm.

Close.

Could save the files onto Indigo server and access them locally?

Will continue thinking.
(still have to solve the multiple icloud email issues - but hopefully can setup own UUID in pyicloud)

Mmm.. Does not seem possible to use php to redirect to local storage?
WebServer http://192.168.1.206:85/control/fmf/example.php load error: HTTP Error 302: Found - Redirection to url 'file:///Users/Indigo/Pictures/data/file.jpg' is not allowed


Glenn

Posted on
Wed Jan 14, 2015 5:26 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Refreshing URL Header Info

You shouldn't need to redirect in your PHP. Schedule the PHP script to run every x minutes, and have it save the file to /some/path/wherever/you/want.

Then, your control page just references the image file location, not the PHP.

Posted on
Wed Jan 14, 2015 6:37 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Refreshing URL Header Info

Thanks - could - but given location data - frequency would have to be all the time to be useful.

Would prefer to be able to trigger update from within Control Page.

Will have a look at Action Groups - triggering an update of the locally stored image. (with an update button or similar)

Glenn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron