-
- 8 Posts
Hi,
I’d like to scrape some text off a government web site (which is legal) and display it in a page on my site. Their data is dynamic so it would have to be some sort of real-time scrape.
I was curious if you guys would know the easiest way to get this done?
-
- 1 Posts
Here use this snippet to grab a URL.
# Usage:
# [ [Grab?wurl=full_URL_no_quotes] ]
function GetPageData($pageurl) { return(file_get_contents($pageurl)); }
function GrabPage($pageurl) {
$pageurl = GetPageData($pageurl);
$pagecontent = $pageurl;
return($pagecontent);
}
$html = GrabPage($wurl);
return ($html);
-
- 1 Posts
I found it in my sandbox and share but wonder where I got it!
Mark, thanks for claiming it!
-
- 356 Posts
I tried to use the grab snippet to pull in phplist, pulled the subscribe page but when you click on subscribe it goes back to default home doc instead of continuing with the subscribe,
would be cool to have an effective function that can pull in things like phplist, forums, etc without the IFRAME, seems like a serverside include sort of function.
one challenge in modfiying another site to match the look of the modx side is you’ll have to mannual create text menu links since usually the modx menus are pulled in via a snippet or two.