My first thought (judging by how you asked the question) was that you probably aren't familiar enough with PHP, or programming in general, to write your "program" without being shown, step-by-step, how to do it.
Do you have anything "so far"? Any code? Any plans for how you might approach the task? If you have nothing, then you're basically asking someone to "do it for you."
My second thought was that this might be a school assignment. If that's the case, I would be even less inclined to "do it for you." On the other hand, if you care to demonstrate that you can make a serious attempt, I might enjoy helping you through it if specific problems come up.
You might start by studying the cURL and DOM (and/or SimpleXML) extensions.