WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: bupaje on September 02, 2008, 07:20:54 AM

Title: [Request] Auto download file snippet
Post by: bupaje on September 02, 2008, 07:20:54 AM
I was wondering if someone could share a bit of code. I would like to download this file https://ssl.google-analytics.com/ga.js and save it into my template folder and overwrite the existing one every so often. I'm just trying to speed up the code a little by hosting a local copy of this file. Maybe tie it to a simple count or date thing so it is only run once on the 1st and 15th of each month as the file won't change often -usually only once or twice a year but if I miss it it screws up your stats..

I tried a few things by hacking different code from the net but couldn't get anything to work. I even tried to auto download it to my desktop folder and then use a sync program to update the web folder but a few hours later I realized I might be better off asking than creating a Rube Goldberg machine -which is where this seems to be headed. :)

Thanks for any help.
Title: Re: [Request] Auto download file snippet
Post by: SourDough on September 02, 2008, 03:38:27 PM
Can you use cron and wget?

Nick
Title: Re: [Request] Auto download file snippet
Post by: bupaje on September 02, 2008, 03:57:34 PM
I can't use cron -not available. Wget -hadn't seen that. I guess I can use that on my pc to download the file and maybe I can set up a webdav folder and save it there? Will take a look. I still wouldn't mind a php solution but I'll try. Thanks.