Approve the Cookies
This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and our Privacy Policy.
OK
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Guest
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Register to forums    Log in

 
FORUMS General Gear Talk Computers 
Thread started 20 Apr 2010 (Tuesday) 00:58
Search threadPrev/next
sponsored links (only for non-logged)

Software to download jpeg from internet every 5 mins then rename?

 
tim
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 20, 2010 00:58 |  #1

I'm trying to work out traffic patterns, so I can work out when I need to be in the car by to avoid traffic. I want to download images from four set URLs every 5 minutes, for a day or three, and have it rename the images in some way so I can tell which camera and what time the image is from.

I can write a piece of software to do this in maybe an hour, but if there's anything around I can download that'd be way easier. Anyone know of anything like that?


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
primoz
POTN Sports Photographer of the year 2005
Avatar
2,532 posts
Likes: 2
Joined Dec 2004
Location: Anywhere where ski World cup makes its stop
     
Apr 21, 2010 02:19 |  #2

Windows? Good luck. Unix (Mac included)? Piece of cake with short shell or perl script.


PhotoSI (external link) | Latest sport photos (external link)http://www.photo.si (external link)

  
  LOG IN TO REPLY
tim
THREAD ­ STARTER
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 21, 2010 02:32 |  #3

I don't really do perl, though I have in the past. I could knock it up in Java easy as, or PHP with a bit more thought.


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
int2str
Goldmember
1,881 posts
Likes: 2
Joined Mar 2009
Location: Fremont, CA
     
Apr 21, 2010 02:50 |  #4

So it's on Windows?
Are the images a directly accessible URL? As in, it's not an embedded image but one you can directly link to?

If so, do this:
1. Install Cygwin (http://cygwin.org (external link))
2. Start cygwin and write a shell script as following:

#!/bin/sh

while :
do
wget "http://www.dot.ca.gov​/dist11/d11tmc/sdmap/r​ealtdata/realtmap.jpg"
sleep 600
done

3. Execute script

This will download the image at the URL every 10 minutes. You can add more wget commands as necessary.



  
  LOG IN TO REPLY
tim
THREAD ­ STARTER
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 21, 2010 02:58 |  #5

That's pretty stupidly simple, thanks! How about renaming it based on the time? I don't want to overwrite the old files and would love a timestamp.

I might just run it on my unix box at work, it's on anyway.


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
primoz
POTN Sports Photographer of the year 2005
Avatar
2,532 posts
Likes: 2
Joined Dec 2004
Location: Anywhere where ski World cup makes its stop
     
Apr 21, 2010 03:25 |  #6

Just add following before "sleep 600":

timestamp=`date "+%Y%m%d%H%M"`
mv realtmap.jpg $timestamp.jpg

PS: this would work on Unix, but I really have no experience with Cygwin on Windows.

PS #2: This would give you file 201004211025.jpg (for 21st of April 2010 at 10:25).


PhotoSI (external link) | Latest sport photos (external link)http://www.photo.si (external link)

  
  LOG IN TO REPLY
tim
THREAD ­ STARTER
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 21, 2010 03:56 |  #7

Perfect, thank you!

For bonus points how would I add 17 hours to the timestamp, so I can run it on my server in the US but get it in local time? Feel free to tell me to go chase parked cars ;)


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
primoz
POTN Sports Photographer of the year 2005
Avatar
2,532 posts
Likes: 2
Joined Dec 2004
Location: Anywhere where ski World cup makes its stop
     
Apr 21, 2010 04:10 |  #8

Now you are pushing... so go chase parked cars :P

Ok seriouslly... Whole thing would look like this then:

#!/bin/sh

while :
do
wget "http://www.dot.ca.gov​/dist11/d11tmc/sdmap/r​ealtdata/realtmap.jpg"
datestamp=`date "+%Y%m%d"`
hour=`date "+%H"`
minute=`date "+%M"`
hour17=`expr $hour + 17`
mv realtmap.jpg $datestamp$hour17$minu​te.jpg
sleep 600
done

Edit: Shi*** this won't do really good, since your day would be from 17:00 till 41:59, which probably wouldn't make much sense


PhotoSI (external link) | Latest sport photos (external link)http://www.photo.si (external link)

  
  LOG IN TO REPLY
tim
THREAD ­ STARTER
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 21, 2010 04:18 |  #9

Haha, Java's time zone aware so it'd be trivial! No matter if the timestamp's not perfect, one of the images I need has a timestamp written on it so that'll give me all I need.

Thanks again for your help, it's running on my hosted server and will grab images for me until stop it... or get kicked off the server for inappropriate use! Maybe i'll run it at work... :)


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
sponsored links (only for non-logged)

2,253 views & 0 likes for this thread, 3 members have posted to it.
Software to download jpeg from internet every 5 mins then rename?
FORUMS General Gear Talk Computers 
AAA
x 1600
y 1600

Jump to forum...   •  Rules   •  Forums   •  New posts   •  RTAT   •  'Best of'   •  Gallery   •  Gear   •  Reviews   •  Member list   •  Polls   •  Image rules   •  Search   •  Password reset   •  Home

Not a member yet?
Register to forums
Registered members may log in to forums and access all the features: full search, image upload, follow forums, own gear list and ratings, likes, more forums, private messaging, thread follow, notifications, own gallery, all settings, view hosted photos, own reviews, see more and do more... and all is free. Don't be a stranger - register now and start posting!


COOKIES DISCLAIMER: This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and to our privacy policy.
Privacy policy and cookie usage info.


POWERED BY AMASS forum software 2.58forum software
version 2.58 /
code and design
by Pekka Saarinen ©
for photography-on-the.net

Latest registered member is semonsters
1534 guests, 131 members online
Simultaneous users record so far is 15,144, that happened on Nov 22, 2018

Photography-on-the.net Digital Photography Forums is the website for photographers and all who love great photos, camera and post processing techniques, gear talk, discussion and sharing. Professionals, hobbyists, newbies and those who don't even own a camera -- all are welcome regardless of skill, favourite brand, gear, gender or age. Registering and usage is free.