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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus »

What about:

Code: Select all

put the htmltext of widget "Browser" into field "PlainText"
8)
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

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

Post 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!
(='.'=)
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

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

Post 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!
(='.'=)
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

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

Post 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!
(='.'=)
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

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

Post by Mariasole »

...wie mein Deutsch! :D
I understand ... Thanks for the solution, I do a "parse" to remove the css! 8)

Vielen Dank!
(='.'=)
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

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

Post 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)
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

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

Post 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!
(='.'=)
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

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

Post by jmburnod »

Hi Maria,
Works fine for me (OS X 10.13)
Best
Jean-Marc
https://alternatic.ch
Post Reply