Pull text from another website

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 24, 2009   (RSS)

By blind2uriz - June 23, 2009

I have been trying to figure this one out for awhile now. Does anyone know how to pull just text from another website w/o bringing the pictures over using php. I used this and got the whole page w/ pictures.

<?php $url="http://www.url-here.html";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);
// you can do something with $data like explode(); or a preg match regex to get the exact information you need
echo $data; ?>

Any help is greatly appreciated. Thanks in advance.

John
John C. Morris
Interdimensional Designs
www.covdesigns.com

Re: [blind2uriz] Pull text from another website

By ross - June 24, 2009

Just another quick note. My idea in the previous post was based on this bit of code I found when doing some google searching:

$cleaned = preg_replace('/<a href=\"(.*?)\">(.*?)<\/a>/', "\\2", $dirty)

Like I said though, that's probably as far as we can take this through support. Feel free to email in consulting (consulting@interactivetools.com). There might be some more options that way.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/