1 ! Copyright (C) 2012 Eungju PARK.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: byte-arrays command-line destructors formatting io kernel
4 math math.parser namespaces sequences splitting strings zeromq
6 IN: zeromq.examples.wuclient
10 <zmq-context> &dispose
11 "Collecting updates from weather server…" print
12 ZMQ_SUB <zmq-socket> &dispose
13 dup "tcp://localhost:5556" zmq-connect
14 command-line get [ "10001 " ] [ first ] if-empty
15 2dup >byte-array ZMQ_SUBSCRIBE swap zmq-setopt
18 >string words [ string>number ] map second +
21 / "Average temperature for zipcode '%s' was %dF\n" printf