xkcd: need to html-unescape.

db4
John Benediktsson 2014-11-12 19:44:25 -08:00
parent 4fce958402
commit 9f44b1c37a
1 changed files with 7 additions and 6 deletions

View File

@ -1,11 +1,11 @@
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: accessors formatting html.parser html.parser.analyzer
html.parser.printer http.client images.http images.viewer
images.viewer.prettyprint io io.streams.string kernel parser
prettyprint.custom prettyprint.sections regexp sequences strings
ui wrap.strings ;
USING: accessors formatting html.entities html.parser
html.parser.analyzer html.parser.printer http.client images.http
images.viewer images.viewer.prettyprint io io.streams.string
kernel parser prettyprint.custom prettyprint.sections regexp
sequences strings ui wrap.strings ;
IN: xkcd
@ -22,7 +22,8 @@ IN: xkcd
: comic-text ( url -- string )
http-get nip parse-html
"transcript" find-by-id-between
[ html-text. ] with-string-writer ;
[ html-text. ] with-string-writer
html-unescape ;
: comic-text. ( url -- )
comic-text 80 wrap-string print ;