js to read html source

Ad.'s icon

Hi, Iam a beginer in javascript in max.
I would like to include in max some daily thoughts from html site, here's the script :

Could you give me some clues to see those daylies sentences in js object ?

Thx in advance.

Ad.

Ad.'s icon

anybody ?

pdelges's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You don't need JavaScript, but Jitter:

Ad.'s icon

Thx Patrick.
Can you explain a little bit the " @re (.*) ? " (mean the entire @re, but I can't paste it to my post…).

Thx.
Ad

pdelges's icon

If you double click in jit.textfile, you'll see the file received.

As you can see, the text you want is surrounded by a html tag.

So, what we want is between and

In regexp's syntax, blahblah can be represented by .*, which means "0 or more characters".
Then comes (.*), which mean: let's memorize a string with "0 or more characters" followed by

This memorized string is sent thru jit.str.regexp's third outlet.

Et voilà.

p

Ad.'s icon

merci à toi.
Ad÷

pdelges's icon

As I see with today's message, there may be some extra work to do to replace the HTML character encoding (like today's "ˆ") with ascii char (i.e. î). This can be done with regexp too, but there are a lot of char to convert... I suppose there are some JavaScript sources on the web to do that.

Ad.'s icon

Hi again.
I'haven't found any js to make this, so I'm gonna use jit.regexp according to http://www.octadyne.com/html_entity_acsii_table.cfm .

I make a try with the & u c i r c ; When I want to substitute it with the ù, a backreference error occurs…although it does work with "t" for instance………

Is there a way out from this problem ?
thx you in advance.

Ad.

Patch and html source:

673.My.patch.zip
zip