Pull text from another website

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

Re: [blind2uriz] Pull text from another website

By ross - June 24, 2009

Hi John

Thanks for posting!

This one will likely go a bit beyond what we can do in support but I think you'll want to try taking a look at the preg_replace() function:


http://ca2.php.net/preg_replace


That should let you remove everything between two characters so if you are stripping out images, set it up to remove everything from "<img" to ">". Of course, you'll then want to run another replace to get rid of all the <img> tags that first command would leave behind.

Now, it could end up being that there is a great function that will do this all at once. If anyone else out there had any ideas, let us know :).

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/

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/