Page 4 of 4

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 10:02 am
by Klaus
What about:

Code: Select all

put the htmltext of widget "Browser" into field "PlainText"
8)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 11:13 am
by Mariasole
Now Works!! Many thanks Klaus.... but....

Is there a way to copy all the text, the plain text, contained in the html page, not its code?

Something like...

Code: Select all

put the TEXT of widget "Browser" into field "PlainText"
Or should Ido javascript? :shock:

Grazie mille!
(='.'=)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 11:40 am
by Klaus
Buongiorno Maria,

certo, there is a trick with "the templatefield":

Code: Select all

...
set the htmltext of the templatefield to the htmltext of widget "Browser"
put the text of the templatefield into fld "PlainText"

## Important to avoid surprises when creating a new field later!
## Although I think hte IDE also takes care of that.
reset the templatefield
...
Best

Klaus

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 1:40 pm
by Mariasole
Thank you Klaus for teaching me a new element of LC! :D
[Sei sempre molto carino e gentile (e molto bravo!)]

I also saw that creating a new field there was the setting "new" .... I have indeed written "put empty into templatefield" and everything is back ok. 8)

I then did a test on example.com

The result was this:
-------------------------------------------------------------------


Example Domain body { background-color: #f0f0f2; margin: 0; padding: 0; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } div { width: 600px; margin: 5em auto; padding: 50px; background-color: #fff; border-radius: 1em; } a:link, a:visited { color: #38488f; text-decoration: none; } @media (max-width: 700px) { body { background-color: #fff; } div { width: auto; margin: 0 auto; border-radius: 0; padding: 1em; } }
Example Domain

This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.

More information...
-------------------------------------------------------------------



I would have expected:

-------------------------------------------------------------------
This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.

More information...
-------------------------------------------------------------------


I have Windows 7 and LC 8.1.9, do you see the same thing?

Grazie mille!
(='.'=)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 1:59 pm
by Klaus
Hi Maria,

what you see is the CSS inside of the html, but since LCs implementation of HTML is VERY basic, CSS is obviously considered as NON html, but only text. Sorry!


Best

Klaus

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 2:11 pm
by Mariasole
Grazie Klaus!
Ho capito... Grazie davvero per la soluzione, faccio io un "parse" per toglierli! 8)
Grazie ancora Klaus

Du bist eine besondere Person!
(='.'=)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 2:18 pm
by Klaus
Buongiorno Maria,

to be honest, my italian is almost non-existent or (speaking this fluently):
Io non posso parlare italiano! :D


Best

Klaus

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 2:43 pm
by Mariasole
...wie mein Deutsch! :D
I understand ... Thanks for the solution, I do a "parse" to remove the css! 8)

Vielen Dank!
(='.'=)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 24, 2018 10:39 pm
by richmond62
Just tried Klaus' recipe on a Macintosh system (10.7.5) and it worked perfectly!
htmlStrip.jpg
htmlStrip.livecode.zip
(5.19 KiB) Downloaded 371 times
no parsing, no nothing.

of course that could be my choice of webpage 8)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 31, 2018 2:34 pm
by Mariasole
of course that could be my choice of webpage 8)
Thanks Richmond,
could you try on Mac with the site "example.com"?
On Win 7 I always have the problem of ghost css!

parsing.jpg


Vielen Dank!
(='.'=)

Re: livecode and *Readability.js* (='.'=)

Posted: Thu May 31, 2018 5:44 pm
by jmburnod
Hi Maria,
Works fine for me (OS X 10.13)
Best
Jean-Marc