#lang racket (require net/url) (provide (contract-out [live-web-value (-> string? string? string? number?)])) (define (live-web-value url key-line regexp-pattern) (let* ((in (get-pure-port (string->url url))) (the-line (do ((the-line (read-line in) (read-line in))) ((regexp-match key-line the-line) the-line)))) (string->number (first (regexp-match regexp-pattern the-line)))))