Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Hasin Hayder's Blog:
Web scrapping in a smart way, making a "Today in History" object in PHP
Apr 29, 2008 @ 15:27:41

Hasin Hayder has written up a quick tutorial for his blog that shows how to create your own "Today in History" page with details from Scopesys pulled with a little web scraping.

There are thousands of services available on web who are presenting interesting as well as education information which you can really integrate in your web page or make a nice widget and let others use them seamlessly with their content delivery platforms. In this article I am going to show you how you can make a nice Today-in-History widget with the help of the data provided in Scopesys.

He wisely recommends that you check one thing first about the content you're grabbing - the copyright it carries with it. This could get you into big trouble down the line depending on whose content it is. The actual script is pretty simple - he defines some constants as markers for where things start and stop in the HTML and then uses strpos to get the locations for his substr call to grab the segments.

tagged: todayinhistory widget copyright scopesys constant define substr strpos

Link:


Trending Topics: