Re: [WebDNA] Extracting contents of a div

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109116
interpreted = N
texte = --Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii TCPCONNECT and then MIDDLE the contents. Have a look at this: [!]***** Get the data from=20 http://www.x-rates.com/d/AUD/table.html *****[/!] [text show=3DF]crlf=3D[unurl]%0D%0A[/unurl][/text] [text show=3DF]PageCapture00=3D[tcpconnect = host=3Dwww.x-rates.com&port=3D80&ssl=3DF][!] [/!][tcpsend skipheader=3DT]POST /d/AUD/table.html = HTTP/1.0[UnURL]%0D%0A[/UnURL][!] [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT = 5.0)[UnURL]%0D%0A[/UnURL][!] [/!][UnURL]%0D%0A[/UnURL][!] [/!][UnURL]%0D%0A[/UnURL][!] [/!][/TCPSend][!] [/!][/tcpconnect][/text] [text show=3DF]PageCapture01=3D[Middle StartAfter=3D[url][/url]&endbefore=3D[url]historical = graphs[/url]][PageCapture00][/Middle][/Text] [Table name=3Dremovespace&fields=3Dfrom,to] %26nbsp%3B%26nbsp%3B%0A%20%20%26nbsp%3B=09 %26nbsp%3B%0A%20%20%26nbsp%3B: %26nbsp%3B%0A%0A%0A%20%20%26nbsp%3B%26nbsp%3B=09 [/Table] [!] -------------- DETERMINE THE RATES -------------- [/!] UKXR=3D[text show=3DT]UKXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DBritish = Pound][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]&= delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
USXR=3D[text show=3DT]USXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DAmerican = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
= NZXR=3D[text show=3DT]NZXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DNew Zealand = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
= EUXR=3D[text show=3DT]EUXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DEuro][PageCapture01][/Middle][/removehtml][/url][/convertword= s][/middle]&delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]
On 23/05/2012, at 12:30 PM, Diane Blackmore wrote: > Hi >=20 > Is there a WebDNA way of pulling the contents of a DIV from a URL that = is on another domain? >=20 > There are ways of doing thins with jQuery/AJAX, but not from another = domain due to that 'same origin policy'. PHP has a method that goes = something like this; >=20 > $link =3D file_get_contents("http://www.domain.com"); > $file =3D strip_tags($link, "
"); > preg_match_all("/
(?:[^<]*)<\/div>/is", $file, $content); > print_r($content);=20 > ?> >=20 > Obviously [include] requires the file be on the same domain/directory, = and I can't think of any other way of doing this. >=20 > Ideas?? >=20 >=20 > Thanks in advance, >=20 > >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii TCPCONNECT and then MIDDLE the = contents.


Have a look at = this:


[!]***** Get the data from 
[text = show=3DF]crlf=3D[unurl]%0D%0A[/unurl][/text]

[text = show=3DF]PageCapture00=3D[tcpconnect = host=3Dwww.x-rates.com&port=3D80&ssl=3DF][!]
[/!][tcpsend skipheader=3DT]POST /d/AUD/table.html = HTTP/1.0[UnURL]%0D%0A[/UnURL][!]
[/!]USER-AGENT: Mozilla/4.0 = (compatible; MSIE 5.01; Windows NT = 5.0)[UnURL]%0D%0A[/UnURL][!]
[/!][UnURL]%0D%0A[/UnURL][!]
[/!][UnURL]%0D%0A[/UnURL][!]
[/!][/TCPSend][!]
[/!][/tcpconnect][/text]

[text = show=3DF]PageCapture01=3D[Middle StartAfter=3D[url]<table width=3D350 border=3D0 cellpadding=3D1 cellspacing=3D0 = bgcolor=3D#999999>[/url]&endbefore=3D[url]historical = graphs[/url]][PageCapture00][/Middle][/Text]

[Table = name=3Dremovespace&fields=3Dfrom,to]
%26nbsp%3B%26nbsp%3B%0A%20%20%26nbsp%3B
%26nbsp%3B%0A%20%20%26nbsp%3B:
%26nbsp%3B%0A%0A%0A%20%20%26nbsp%3B%26nbsp%3B=
[/Table]

[!] = --------------  DETERMINE THE RATES -------------- [/!]
UKXR=3D[text show=3DT]UKXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DBritish = Pound][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]&= amp;delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
USXR=3D[text = show=3DT]USXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle StartAfter=3DAmerican = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
NZXR=3D[text = show=3DT]NZXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle StartAfter=3DNew Zealand = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
EUXR=3D[text = show=3DT]EUXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle = StartAfter=3DEuro][PageCapture01][/Middle][/removehtml][/url][/convertword= s][/middle]&delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>











On = 23/05/2012, at 12:30 PM, Diane Blackmore wrote:

Hi

Is there = a WebDNA way of pulling the contents of a DIV from a URL that is on = another domain?

There are ways of doing thins = with jQuery/AJAX, but not from another domain due to that 'same origin = policy'. PHP has a method that goes something like = this;

<?php
  $link
=3D file_get_contents("http://www.domain.com");
  $file
=3D strip_tags($link, "<div>");
  preg_match_all
("/<div/>(?:[^<]*)<\/div>/is", $file, $content);
  = print_r
($content);
?>

Obviously = [include] requires the file be on the same domain/directory, and I can't = think of any other way of doing = this.

Ideas??


=
Thanks in advance,

<CohesionSig_Diane12.gif>

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Extracting contents of a div (Stuart Tremain 2012)
  2. Re: [WebDNA] Extracting contents of a div (Govinda 2012)
  3. [WebDNA] Extracting contents of a div (Diane Blackmore 2012)
--Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii TCPCONNECT and then MIDDLE the contents. Have a look at this: [!]***** Get the data from=20 http://www.x-rates.com/d/AUD/table.html *****[/!] [text show=3DF]crlf=3D[unurl]%0D%0A[/unurl][/text] [text show=3DF]PageCapture00=3D[tcpconnect = host=3Dwww.x-rates.com&port=3D80&ssl=3DF][!] [/!][tcpsend skipheader=3DT]POST /d/AUD/table.html = HTTP/1.0[unurl]%0D%0A[/UnURL][!] [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT = 5.0)[unurl]%0D%0A[/UnURL][!] [/!][unurl]%0D%0A[/UnURL][!] [/!][unurl]%0D%0A[/UnURL][!] [/!][/TCPSend][!] [/!][/tcpconnect][/text] [text show=3DF]PageCapture01=3D[Middle StartAfter=3D[url][/url]&endbefore=3D[url]historical = graphs[/url]][PageCapture00][/Middle][/Text] [Table name=3Dremovespace&fields=3Dfrom,to] %26nbsp%3B%26nbsp%3B%0A%20%20%26nbsp%3B=09 %26nbsp%3B%0A%20%20%26nbsp%3B: %26nbsp%3B%0A%0A%0A%20%20%26nbsp%3B%26nbsp%3B=09 [/Table] [!] -------------- DETERMINE THE RATES -------------- [/!] UKXR=3D[text show=3DT]UKXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DBritish = Pound][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]&= delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
USXR=3D[text show=3DT]USXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DAmerican = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
= NZXR=3D[text show=3DT]NZXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DNew Zealand = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif [index]=3D1][word][/showif][/ListWords][/text]
= EUXR=3D[text show=3DT]EUXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DEuro][PageCapture01][/Middle][/removehtml][/url][/convertword= s][/middle]&delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]
On 23/05/2012, at 12:30 PM, Diane Blackmore wrote: > Hi >=20 > Is there a WebDNA way of pulling the contents of a DIV from a URL that = is on another domain? >=20 > There are ways of doing thins with jQuery/AJAX, but not from another = domain due to that 'same origin policy'. PHP has a method that goes = something like this; >=20 > $link =3D file_get_contents("http://www.domain.com"); > $file =3D strip_tags($link, "
"); > preg_match_all("/
(?:[^<]*)<\/div>/is", $file, $content); > print_r($content);=20 > ?> >=20 > Obviously [include] requires the file be on the same domain/directory, = and I can't think of any other way of doing this. >=20 > Ideas?? >=20 >=20 > Thanks in advance, >=20 > >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii TCPCONNECT and then MIDDLE the = contents.


Have a look at = this:


[!]***** Get the data from 
[text = show=3DF]crlf=3D[unurl]%0D%0A[/unurl][/text]

[text = show=3DF]PageCapture00=3D[tcpconnect = host=3Dwww.x-rates.com&port=3D80&ssl=3DF][!]
[/!][tcpsend skipheader=3DT]POST /d/AUD/table.html = HTTP/1.0[unurl]%0D%0A[/UnURL][!]
[/!]USER-AGENT: Mozilla/4.0 = (compatible; MSIE 5.01; Windows NT = 5.0)[unurl]%0D%0A[/UnURL][!]
[/!][unurl]%0D%0A[/UnURL][!]
[/!][unurl]%0D%0A[/UnURL][!]
[/!][/TCPSend][!]
[/!][/tcpconnect][/text]

[text = show=3DF]PageCapture01=3D[Middle StartAfter=3D[url]<table width=3D350 border=3D0 cellpadding=3D1 cellspacing=3D0 = bgcolor=3D#999999>[/url]&endbefore=3D[url]historical = graphs[/url]][PageCapture00][/Middle][/Text]

[Table = name=3Dremovespace&fields=3Dfrom,to]
%26nbsp%3B%26nbsp%3B%0A%20%20%26nbsp%3B
%26nbsp%3B%0A%20%20%26nbsp%3B:
%26nbsp%3B%0A%0A%0A%20%20%26nbsp%3B%26nbsp%3B=
[/Table]

[!] = --------------  DETERMINE THE RATES -------------- [/!]
UKXR=3D[text show=3DT]UKXR=3D[Listwords words=3D[middle = EndBefore=3D:][convertwords table=3Dremovespace][url][removehtml][Middle = StartAfter=3DBritish = Pound][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]&= amp;delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
USXR=3D[text = show=3DT]USXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle StartAfter=3DAmerican = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
NZXR=3D[text = show=3DT]NZXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle StartAfter=3DNew Zealand = Dollar][PageCapture01][/Middle][/removehtml][/url][/convertwords][/middle]= &delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>
EUXR=3D[text = show=3DT]EUXR=3D[Listwords words=3D[middle EndBefore=3D:][convertwords = table=3Dremovespace][url][removehtml][Middle = StartAfter=3DEuro][PageCapture01][/Middle][/removehtml][/url][/convertword= s][/middle]&delimiters=3D:][showif = [index]=3D1][word][/showif][/ListWords][/text]<BR>











On = 23/05/2012, at 12:30 PM, Diane Blackmore wrote:

Hi

Is there = a WebDNA way of pulling the contents of a DIV from a URL that is on = another domain?

There are ways of doing thins = with jQuery/AJAX, but not from another domain due to that 'same origin = policy'. PHP has a method that goes something like = this;

<?php
  $link
=3D file_get_contents("http://www.domain.com");
  $file
=3D strip_tags($link, "<div>");
  preg_match_all
("/<div/>(?:[^<]*)<\/div>/is", $file, $content);
  = print_r
($content);
?>

Obviously = [include] requires the file be on the same domain/directory, and I can't = think of any other way of doing = this.

Ideas??


=
Thanks in advance,

<CohesionSig_Diane12.gif>

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_FA28BEA7-DF2C-4497-B73A-EA7326096259-- Stuart Tremain

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WC2f3 (1997) FORMS: Returning a specific page (1997) more on quicktime test stuff (1997) Carat character in path (2001) MY SOLUTION.... Send massmail (2000) multi-paragraph fields (1997) Before I Can Begin . . . (1998) WebCatalog for guestbook ? (1997) Looking for a Manual (1997) 2.0 Info (1997) WebCat2: Items xx to xx shown, etc. (1997) MacAuthorize order data fields WAS:How To question... (1997) WebCatalog Mac 2.1b3 (1997) Imagemagick and fonts (2004) RE: [WebDNA] ubuntu can't append db (2019) Size limit for tmpl editor ? (1997) Nested tags count question (1997) Forms Search Questions (1997) [ShowNext] (1997) Re:Non-technical messages ... (1997)