Lately, I have been doing a lot of gimmicks with various things related to sending and receiving data over web pages in the back end, i.e. without the user actually browsing or sending data. I have done quite some research on the subject. I did find some noteworthy things. cURL was the first method that I came accross. Like most of the php guys would do, I jumped on to it. Used cURL for some applications I was developing. These applications required a lot of web page openings.
Now, as most of you experienced users might be knowing, or for the newbies, I found that, many of my scripts, the timed out. And my shared host, at gohindi dot com, that idiot, suspended my account for nothing. He said, he couldn’t take the load of the scripts. So, my site hung up in a stupid suspended page (Sorry guys, you might have missed me 🙂 ).
So, I started looking for other options. Changing to a dedicated or a VPS was out of option, as it proved to be too costly. So I decided to change the technology. What I found was fsock was the next best option. Though not pirticularly easy to use, it was something that was useful. Then, this brilliant idea struck me. I explored, file_get_contents function of PHP. It did solve my problem, as long as I didnt have to post any data. So I stuck with it. It was fun. I could get the things done in an instant. And it was pretty safe and easy too.
Thus in a single line statement I could do what required a few lines in fsock as well as cURL. This was a nice method, but had its limitations. I couldn’t post data to these sites. So, I decided to come up with a class. This would surely make an ease. This class is useful for the newbies. It is called pageFetcher. So, ladies and gentlemen, here I present to you,