A couple of years ago I made a small personal project called “Comic Aggregator”. The essence of the project is that there are a lot of sites with comics, which have no RSS feeds. And I was frankly too lazy to go to these sites manually and check for updates.
Therefore, a primitive "spider" was written, bypassing sites on a schedule, parsing the contents of the pages and picking up information about updates and adding this information to the database, from which another script, viewer, generated RCC, Atom or Xtml.
To access the sites, it was decided to use the PHP lib_curl module. It was possible, of course, to get by with simple functions like file_get_contents (), but this function did not give me some necessary features (for example, get http statuses and headers), and I did not have wget on my hosting. Yes, and PHP-modules for him I do not know.
')
Having checked the documentation for the module, I decided that it makes sense to write a small library that would save you from writing a heap of the routine code needed to work with the coil, and also provide htp answers in the form of a convenient OOP interface. In about a week of unhurried coding and a month of debugging, the library was written and for two years now I have been using it on several similar projects.
A few people to whom I showed the source, said that the thing turned out quite comfortable and it would be nice to make it publicly available. In addition, several potential employers wanted to see my code. Therefore, it was decided to post
Snismumrik on
Gitkhab . And give the link to everyone.
I do not pretend to the novelty of the idea and embodiment. I would be glad if this thing is useful to anyone in business.
So, what can be done with the help of Snusmurik:
- Configure the basic parameters Kurly through an array of config;
- Send HTTP requests through Kurlu using a set of class methods;
- Masked under the most common browsers;
- Do not bother with the analysis of the response headers;
- Do not bother with the analysis of cookies;
- Using already received cookies login to the sites.
What the Snusumrik does not know how:
- Work on https. Someday I will definitely find a piece of time to figure out the basics of working through the htpps protocol and correct this misunderstanding.
Documentation of snooms with usage examples can be found in the
Githab repository , in the Readme.txt file. While in English, over time, I plan to make a Russian version of it.
Alternatives:
-
PEAR HTTP_Request2 ;
-
Zend_Http_Client ;
-
Snoopy ;
-
gCurl .