You could do that using wget, but i don't know how much you know about apps like that which runs on either linux or freebsd but I'd suggest you try building a similiar one by yourself, the knowledge you gain will help you in the long run.
"Remember Amateurs built the Ark -- Professionals built the Titanic."