Re: [WebDNA] Middle Question
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 112034
interpreted = N
texte = It seems to me this can be done with [regex]. Wait for 8.0.3- chris> On 23 Jan 2015, at 19:29, David Bastedo
wrote:>=20> Thanks Ken & Tom,>=20> as soon as I understood what Ken was saying, I knew what I want to do =is impossible>=20> I literally want to pluck open graph or other meta data off of a page, =no matter where it is by just using its tag and an end point.>=20> If I know what tags I am looking for explicitly - I could put them in =a table and loop through looking for whatever I wanted, then I could =define the end - working "forward" from the opening of the tag "og: =title" for example, and end at the close of the tag "/" and be able to =pull out dynamically any meta tag I could possibly think of.... or want.>=20> That would be pretty straight forward and very powerful.> I can accomplish this task by creating a one off relationship between =a page and its tags - say for twitter - its an easy way to grab an image =- but its not dynamic I want to do this for any type of page.>=20> d.>=20> On Fri, Jan 23, 2015 at 7:35 AM, Tom Duke =wrote:> David,>=20> Hi - you won't be able to achieve what you are trying to do with =[middle]. You might be able to hack something together using [grep] or =[listwords]. Though Stackoverflow is full of articles outlining why =regex should not be used to parse HTML. =(http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-x=html-self-contained-tags/1732454#1732454)>=20> Your example shows why a proper HTML parser within WebDNA would be =really useful. For example if you paste your code into this page:>=20> http://try.jsoup.org>=20> and type "meta" into the CSS Query box you'll see how a HTML parser =does the job.>=20> - Tom>=20>=20>=20>=20>=20>=20> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Digital Revolutionaries> 1st Floor, Castleriver House> 14-15 Parliament Street> Temple Bar,Dublin 2> Ireland> ----------------------------------------------> [t]: + 353 1 4403907> [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=20> On 23 January 2015 at 00:11, David Bastedo wrote:> To your point, I never switched out your test variable properly=20> To my point, I hate when you are right.> I get the same results.>=20> However, as opposed to blaming me for not understanding how the =friggin thing works, the docs aren't very clear and after seeing your =example I now understand "backwards" for the reality that it is.>=20> There is no hope in hell of doing what I want with middle.>=20> Your first example is not as good as your second example to illustrate =the concept. Thank you for taking the time with the second example, it =illustrate backwards much more effectively.>=20> d.>=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>=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>=20>=20>=20> --=20> David Bastedo> Ten Plus One Communications Inc.> http://www.10plus1.com> 416.277.4499>=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
Associated Messages, from the most recent to the oldest:
It seems to me this can be done with [regex]. Wait for 8.0.3- chris> On 23 Jan 2015, at 19:29, David Bastedo wrote:>=20> Thanks Ken & Tom,>=20> as soon as I understood what Ken was saying, I knew what I want to do =is impossible>=20> I literally want to pluck open graph or other meta data off of a page, =no matter where it is by just using its tag and an end point.>=20> If I know what tags I am looking for explicitly - I could put them in =a table and loop through looking for whatever I wanted, then I could =define the end - working "forward" from the opening of the tag "og: =title" for example, and end at the close of the tag "/" and be able to =pull out dynamically any meta tag I could possibly think of.... or want.>=20> That would be pretty straight forward and very powerful.> I can accomplish this task by creating a one off relationship between =a page and its tags - say for twitter - its an easy way to grab an image =- but its not dynamic I want to do this for any type of page.>=20> d.>=20> On Fri, Jan 23, 2015 at 7:35 AM, Tom Duke =wrote:> David,>=20> Hi - you won't be able to achieve what you are trying to do with =[middle]. You might be able to hack something together using [grep] or =[listwords]. Though Stackoverflow is full of articles outlining why =regex should not be used to parse HTML. =(http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-x=html-self-contained-tags/1732454#1732454)>=20> Your example shows why a proper HTML parser within WebDNA would be =really useful. For example if you paste your code into this page:>=20> http://try.jsoup.org>=20> and type "meta" into the CSS Query box you'll see how a HTML parser =does the job.>=20> - Tom>=20>=20>=20>=20>=20>=20> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Digital Revolutionaries> 1st Floor, Castleriver House> 14-15 Parliament Street> Temple Bar,Dublin 2> Ireland> ----------------------------------------------> [t]: + 353 1 4403907> [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=20> On 23 January 2015 at 00:11, David Bastedo wrote:> To your point, I never switched out your test variable properly=20> To my point, I hate when you are right.> I get the same results.>=20> However, as opposed to blaming me for not understanding how the =friggin thing works, the docs aren't very clear and after seeing your =example I now understand "backwards" for the reality that it is.>=20> There is no hope in hell of doing what I want with middle.>=20> Your first example is not as good as your second example to illustrate =the concept. Thank you for taking the time with the second example, it =illustrate backwards much more effectively.>=20> d.>=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>=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>=20>=20>=20> --=20> David Bastedo> Ten Plus One Communications Inc.> http://www.10plus1.com> 416.277.4499>=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
christophe.billiottet@webdna.us
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:
(2004)
Does [Sendmail] create html? (2002)
Setting up WebCatalog with Retail Pro data (1996)
WebCat2: Items xx to xx shown, etc. (1997)
RE: Automatic thumbnail images (1998)
Emailer again & again (1997)
Emailer port change (1997)
Lost Field (1998)
[WebDNA] WebDNA in a [TEXT] variable (2013)
NetForms for mail, sorry (1998)
[authenticate] (1999)
NT Setup (1998)
Bug? (1997)
[WebDNA] Error. WebDNA (version 5.1g or later) is not running. (2013)
[WebDNA] path traversal (2020)
[ListFiles] & [loop] (1998)
Security Issues and WebCommerce Solution (1997)
Bad card db - *mislabled post* (1999)
showif field is number (1997)
[TEXT SECURE=T] (2000)