WebsiteDays.com create your web site free, Hosting, Coding, E-commerce, Free Website Builder. Download free website builder to create your website! Personal, and ECommerce website builders...

WebsiteDays.com for ireland butlerstown

Click on your region below to contact a Websitedays.com designer, or Websitedays.com sales person for info about Online Website builder system.

You can also send an email to

and we can forward your enquiry to respective designers in your area.

Abbeydorney Aclare Adare
Adrigole Aglish Ahakista
Annaghdown Annascaul Ardee
Ardfert Arklow Arthurstown
Ashbourne Ashford Athboy
Athenry Athleague Athlone
Athy Avoca Bagenalstown
Balbriggan Baldoyle Ballacolla
Ballina Ballinadee Ballinamore
Ballinasloe Ballincollig Ballineen
Ballingarry Ballinrobe Ballon
Ballybofey Ballybunion Ballycanew
Ballycotton Ballydesmond Ballyheigue
Ballyknockan Ballymacarbry Ballymacelligott
Ballymahon Ballymore Eustace Ballymount
Ballyshannon Ballyvaughan Baltimore
Banagher Bandon Bangor Erris
Bantry Bawnboy Beaufort
Belgooly Belleek Belmullet
Beltra Belturbet Bettystown
Birr Bishopstown Blackrock-Cork
Blackrock-Dublin Blanchardstown Blarney
Blennerville Blessington Borris
Boyle Brandon Village Bray
Bree Bunclody Buncrana
Bundoran Bunratty Butlerstown
Cabra Caher Caherdaniel
Cahir Cahirciveen Callan
Cappoquin Carlow Carna
Carndonagh Carnmore Carrick-on-Shannon
Carrick-on-Suir Carrickmacross Carrigaholt
Carrigaline Carrigallen Cashel-Galway
Cashel-Tipperary Castlebar Castleblayney
Castlebridge Castledermot Castlelyons
Castlemartyr Castletownbere Catherlistrane
Causeway Cavan Celbridge
Charlestown Charleville Clane
Claremorris Clarinbridge Clifden
Clogh Clogheen Cloghran
Clogrennane Clonakilty Clondalkin
Clonee Clonegal Clones
Clonmel Clonroche Clonsilla
Clonskeagh Clontarf Coalbrook
Cobh Collooney Cong
Coolaney Coolbawn Cootehill
Cork Cornamona Corofin
Costelloe Courtmacsherry Courtown
Cratloe Crolly Cross
Crosshaven Crossmolina Culdaff
Daingean Dalkey Derrybeg
Dingle Donegal Town Doneraile
Doolin Doonbeg Dooneen
Douglas Drogheda Dromahair
Drumcondra Drumlish Drumshanbo
Drung Dublin Dun Laoghaire
Dunboyne Dundalk Dundrum
Dunfanaghy Dungarvan Dunkineely
Dunmanway Dunmore East Dunshaughlin
Edenderry Ennis Enniscorthy
Ennistymon Falcarragh Farran
Feakle Fedamore Fermoy
Ferns Fethard Finglas
Foxford Furbo Galway
Garrettstown Geevagh Glandore
Glanmire Glaslough Glasnevin
Glenamaddy Glenbeigh Glencullen
Glendalough Glengarriff Glenties
Glin Glounthane Golden
Gorey Gort Gortahork
Gougane Graiguenamanagh Grange
Grange-Limerick Grange-Sligo Greystones
Gurteen Headford Howth
Inagh Inchigella Inistioge
Kanturk Kells-Kerry Kells-Meath
Kenmare Kilcommon Kilcoole
Kilcorney Kilfenora Kilkee
Kilkenny Kill Killala
Killaloe Killarney Killeshandra
Killiney Killinick Killoe
Killorglin Killybegs Kilmacanogue
Kilmaine Kilmallock Kilmuckridge
Kilrush Kilternan Kiltimagh
Kiltorcan Kimmage Kingscourt
Kinnegad Kinnitty Kinsale
Kinvara Knock Knockatallon
Knockcroghery Knockrooskey Ladysbridge
Lahinch Leenane Leixlip
Letterkenny Limerick Liscannor
Lisdoonvarna Lismore Listowel
Longford Lough Gowna Loughanure
Loughrea Lucan Lusk
Macreddin Macroom Malahide
Mallow Manorhamilton Mayfield
Maynooth Midleton Millstreet Town
Milltown Milltown-Co Kerry Minane Bridge
Mitchelstown Mizen Head Moate
Mohill Monaghan Monasteraden Village
Monasterevin Monkstown Mount Bellew
Mount Merrion Mount Nugent Moville
Moyard Moycullen Mullaghmore
Mullinavat Mullingar Naas
Navan Nenagh New Ross
Newbridge Newcastle West Newgrange
Newport-Mayo Newport-Tipperary OBriens Bridge
Oranmore Oughterard Oylegate
Pallaskenry Palmerstown Peterswell
Pettigo Piltown Pontoon
Portarlington Portlaoise Portlaw
Portmagee Portmarnock Portsalon
Portumna Quilty Quin
Raheny Ranelagh Raphoe
Rathangan Rathcoole Rathdrum
Rathfarnham Rathgormack Rathmullan
Recess Renvyle Riverstown
Roosky Roscahill Roscommon
Roscrea Rosegreen Rosmuck
Rosscarbery Rosses Point Rosslare
Rossnowlagh Roundstone Salthill
Sandyford Santry Scarriff
Scotstown Shankill Shannon
Skerries Skibbereen Slane
Sligo Sneem Spiddal
St. Mullins Stillorgan Sutton
Swinford Swords Tagoat
Tallaght Tallanstown Tallow
Tarbert Templemore Templeogue
The Rower Thomastown Thurles
Tipperary Togher Toormore
Tourmakeady Tralee Tramore
Trim Tuam Tullamore
Tullow Tulsk Tynagh
Unionhall Ventry Waterford
Waterville Westport Wexford
Wicklow Williamstown Woodford
Youghal

»   Screen Scraping Your Way Into RSS

Article submitted in category: Web Design And Development
Tags: | rss | content | echo | get | feed | // | screen | rss feed | using | items | preg_match | phpit | conten

Screen Scraping Your Way Into RSS by: Dennis Pallett Introduction RSS is one the hottest technologies at the moment, and even big web publishers (such as the New York Times) are getting into RSS as well. However, there are still a lot of websites that do not have RSS feeds. If you still want to be able to check those websites in your favourite aggregator, you need to create your own RSS feed for those websites. This can be done automatically with PHP, using a method called screen scrapping. Screen scrapping is usually frowned upon, as it's mostly used to steal content from other websites. I personally believe that in this case, to automatically generate a RSS feed, screen scrapping is not a bad thing. Now, on to the code! Getting the content For this article, we'll use PHPit as an example, despite the fact that PHPit already has RSS feeds (http://www.phpit.net/syndication/). We'll want to generate a RSS feed from the content listed on the frontpage (http://www.phpit.net). The first step in screen scraping is getting the complete page. In PHP this can be done very easily, by using implode(file("", "[the url here>")); IF your web host allows it. If you can't use file() you'll have to use a different method of getting the page, e.g. using the CURL library (http://www.php.net/curl). Now that we have the content available, we can parse it for the content using some regular expressions. The key to screen scraping is looking for patterns that match the content, e.g. are all the content items wrapped in <div>'s or something else? If you can successfully discover a pattern, then you can use preg_match_all() to get all the content items. For PHPit, the pattern that match the content is <div class="contentitem">[Content Here><div>. You can verify this yourself by going to the main page of PHPit, and viewing the source. Now that we have a match we can get all the content items. The next step is to retrieve the individual information, i.e. url, title, author, text. This can be done by using some more regular expression and str_replace() on the each content items. By now we have the following code; <?php // Get page $url = "http://www.phpit.net/"; $data = implode("", file($url)); // Get content items preg_match_all ("/<div class="contentitem">([^`>*?)</div>/", $data, $matches); Like I said, the next step is to retrieve the individual information, but first let's make a beginning on our feed, by setting the appropriate header (text/xml) and printing the channel information, etc. // Begin feed header ("Content-Type: text/xml; charset=ISO-8859-1"); echo "<?xml version="1.0" encoding="ISO-8859-1" ?>n"; ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <channel> <title>PHPit Latest Content</title> <description>The latest content from PHPit (http://www.phpit.net), screen scraped!</description> <link>http://www.phpit.net</link> <language>en-us</language> <? Now it's time to loop through the items, and print their RSS XML. We first loop through each item, and get all the information we get, by using more regular expressions and preg_match(). After that the RSS for the item is printed. <?php // Loop through each content item foreach ($matches[0> as $match) { // First, get title preg_match ("/">([^`>*?)</a></h3>/", $match, $temp); $title = $temp['1'>; $title = strip_tags($title); $title = trim($title); // Second, get url preg_match ("/<a href="([^`>*?)">/", $match, $temp); $url = $temp['1'>; $url = trim($url); // Third, get text preg_match ("/<p>([^`>*?)<span class="byline">/", $match, $temp); $text = $temp['1'>; $text = trim($text); // Fourth, and finally, get author preg_match ("/<span class="byline">By ([^`>*?)</span>/", $match, $temp); $author = $temp['1'>; $author = trim($author); // Echo RSS XML echo "<item>n"; echo "ttt<title>" . strip_tags($title) . "</title>n"; echo "ttt<link>http://www.phpit.net" . strip_tags($url) . "</link>n"; echo "ttt<description>" . strip_tags($text) . "</description>n"; echo "ttt<content:encoded><![CDATA[ n"; echo $text . "n"; echo " >>></content:encoded>n"; echo "ttt<dc:creator>" . strip_tags($author) . "</dc:creator>n"; echo "tt</item>n"; } ?> And finally, the RSS file is closed off. </channel> </rss> That's all. If you put all the code together, like in the demo script, then you'll have a perfect RSS feed. Conclusion In this tutorial I have shown you how to create a RSS feed from a website that does not have a RSS feed themselves yet. Though the regular expression is different for each website, the principle is exactly the same. One thing I should mention is that you shouldn't immediately screen scrape a website's content. E-mail them first about a RSS feed. Who knows, they might set one up themselves, and that would be even better. Download sample script at http://www.phpit.net/viewsource.php/url//demo/screenscrape%20rss/example.php About The Author Dennis Pallett is a young tech writer, with much experience in ASP, PHP and other web technologies. He enjoys writing, and has written several articles and tutorials. To find more of his work, look at his websites at http://www.phpit.net, http://www.aspit.net and http://www.ezfaqs.com This article was posted on December 11, 2004