rbot icon indicating copy to clipboard operation
rbot copied to clipboard

Markov Learn by URL

Open ahill00 opened this issue 13 years ago • 1 comments

This pull request adds in a learn by url plugin which is activated by markov learn_url

ahill00 avatar Apr 03 '12 01:04 ahill00

While I like the concept, the patch has a few issues as-is.

First of all, rather than using a separate command-line instruction I would rather prefer "markov learn from " be used. learn_from() would thus check if the parameter is an url or a filename and act accordingly.

Also, the dependency from w3m is not an approach I like. A better approach would be to get the page content using rbot's own httputil functions to get the text, clean it up using the rbot methods such as ircify_html or riphtml, and then iterate of the lines with .each_line.

The code could actually remain in the same block, just name the source source and iterate wtih source.each_line where source = file in the file path and source = cleaned_text in the url case.

Oblomov avatar Apr 25 '13 05:04 Oblomov