wikipedia: strftime + tests
parent
e10754a298
commit
b9030b953e
|
@ -0,0 +1,8 @@
|
|||
USING: calendar tools.test urls wikipedia.private ;
|
||||
IN: wikipedia.tests
|
||||
|
||||
{
|
||||
URL" http://en.wikipedia.org/wiki/October_10"
|
||||
} [
|
||||
2010 10 10 <date> historical-url
|
||||
] unit-test
|
|
@ -1,10 +1,10 @@
|
|||
! Copyright (C) 2012 John Benediktsson
|
||||
! See http://factorcode.org/license.txt for BSD license
|
||||
|
||||
USING: accessors ascii assocs calendar colors.constants
|
||||
formatting html.entities html.parser html.parser.analyzer
|
||||
html.parser.printer http.client io io.styles kernel namespaces
|
||||
sequences splitting urls wrap.strings xml xml.data xml.traversal ;
|
||||
USING: accessors ascii assocs colors.constants formatting
|
||||
html.entities html.parser html.parser.analyzer html.parser.printer
|
||||
http.client io io.styles kernel namespaces sequences splitting urls
|
||||
wrap.strings xml xml.data xml.traversal ;
|
||||
FROM: xml.data => tag? ;
|
||||
|
||||
IN: wikipedia
|
||||
|
@ -44,7 +44,7 @@ SYMBOL: language
|
|||
children-tags [ item. ] each nl ;
|
||||
|
||||
: historical-url ( timestamp -- url )
|
||||
[ month-name ] [ day>> ] bi "%s_%s" sprintf wikipedia-url ;
|
||||
"%B_%d" strftime wikipedia-url ;
|
||||
|
||||
: (historical-events) ( timestamp -- seq )
|
||||
historical-url http-get nip string>xml "ul" deep-tags-named ;
|
||||
|
|
Loading…
Reference in New Issue