(defparameter *santcruzinfo* (make-hash-table)) (defun product-info (number) (or (gethash number *santcruzinfo*) (let ((page (get-url (format nil "http://www.scbt.com/catalog/action.lasso?-database=catalog&-layout=web_detail&-response=detail.lasso&-token.order_id=0&-search&-op=eq&catalog_number=sc-~2,'0d#prodinfo" number) :dont-cache t))) (when (consp page) (setf (gethash number *santcruzinfo*) page)) (setf (gethash number *santcruzinfo*) (append (list number) (all-matches page "(?s)
([^>]+?)" 1 2) (car (all-matches page "(?s)\\s*\\s*

(.*?): sc-" 1)) (list (mapcar 'car (all-matches page "(?s)\\s*\\s*
    (.*?)
" 1))) (and desc (list (mapcar 'car (all-matches (caar desc) "
  • (.*?)
  • " 1))))) ))))) (defun write-santacruz () (with-open-file (f "~/repos/lsw/trunk/hcls/biordf/reagents/santacruz.txt" :direction :output :if-exists :supersede) (loop for i from 1 for entry = (gethash i *santcruzinfo* :eof) until (eq entry :eof) do (print entry f)))) (defun pull-all-santacruz (&optional (from 0) (to 43000)) (loop for i from from to to do (product-info i) (sleep .002) (princ ".") (if (zerop (mod i 100)) (format t "[~a]" i ))))