 
 USING: accessors ascii assocs calendar colors.constants
 formatting html.parser html.parser.analyzer html.parser.printer
-http.client io io.streams.string io.styles kernel make regexp
-sequences splitting urls wrap.strings xml xml.data
-xml.traversal ;
+http.client io io.streams.string io.styles kernel make
+namespaces regexp sequences splitting urls wrap.strings xml
+xml.data xml.traversal ;
 FROM: xml.data => tag? ;
 
 IN: wikipedia
 
+SYMBOL: language
+"en" language set-global
+
+: with-language ( str quot -- )
+    language swap with-variable ; inline
+
 <PRIVATE
+
+: wikipedia-url ( path -- url )
+    language get swap "http://%s.wikipedia.org/wiki/%s" sprintf >url ;
 
 : header. ( string -- )
     H{ { font-size 20 } { font-style bold } } format nl ;


: link. ( tag -- )
    [ deep-children>string ] [ attrs>> "href" of ] bi
    "http://en.wikipedia.org" prepend >url H{
        { font-name "monospace" }
        { foreground COLOR: blue }
    } [ write-object ] with-style ;

    (historical-events) "Deaths" header. fourth items. ;

: article. ( name -- )
    wikipedia-url http-get* parse-html
    "content" find-by-id-between
    [ html-text. ] with-string-writer string-lines
    [ [ blank? ] trim ] map harvest [
        R/ &lt;/ "<" re-replace
