You need to do two things which are separate cycles. The first is to write a script (in ruby or any language) to grab the flickr data. Once this script works from the command line you can instruct cron to execute the script at certain intervals.
To learn about cron, use google or man cron or man crontab.
Hope this helps.