YASMA - Yes another Stock Market Applet -

Started by newdep, August 26, 2009, 06:41:44 AM

Previous topic - Next topic

newdep

#!/usr/bin/newlisp
#
# simple commandline Google finance
#
# usage:
# $gf.lsp goog
# (Google Inc.) NASDAQ:GOOG [$471.37 0.00% 0.00 149.22B]
#
# enjoy..nodep 2009 v0.1
#

(set 'data (get-url (string {http://www.google.com/finance?q=} (main-args -1)) ))

(when (find {var _ticker = '(.*)';} data 1)
 (setq T $1)                ;; ticker symbol
  (setq M (first (parse T))) ;; market
   (setq S (last (parse T)))) ;; symbol

(when (find {var _companyName = '(.*)';} data 1)  (setq N $1)) ;; company name
(when (find {var _companyId = (.*);} data 1)      (setq I $1)) ;; company id

(when (find (string "id:" I ",values:\[" """ S """ "," """ "(.*)" """ M """ "," """ I """ "," """ S """ ) data 1)
 (map (lambda(x) (replace x $1 " ")) '(""" ","))
  (setq X (parse $1)))

(println (string  "(" N ") " T " [ $" (X -6) "   " (X -3) "%  " (X -5)  "  " (X -2) (X -1) " ]"))

(exit)



http://www.nodep.nl/downloads/newlisp/gf.lsp">//http://www.nodep.nl/downloads/newlisp/gf.lsp





Enjoy..
-- (define? (Cornflakes))