Paste: pastebin-client

Author: dharmatech
Mode: factor
Date: Thu, 13 Nov 2008 19:52:29
Plain Text |
USING: kernel
       namespaces
       sequences
       eval
       io
       io.sockets
       io.encodings.utf8
       math.parser
       calendar
       webapps.pastebin ;

IN: pastebin-client

: talk-to-pastebin ( quot -- )
  T{ inet4 f "127.0.0.1" 9005 } utf8 rot with-client
  "USING: calendar webapps.pastebin ; " prepend eval ; inline

: list-pastes ( -- seq )
  [ "list" print flush input-stream get contents ] talk-to-pastebin ;

: list-paste ( id -- paste )
  [ number>string "get " prepend print flush input-stream get contents ]
  talk-to-pastebin ;

New Annotation

Summary:
Author:
Mode:
Body: