Permalink
Browse files

stock me

  • Loading branch information...
1 parent 7fc397b commit 4f83e0c9f057913a0de1771cd1167d781a30b333 @maddox maddox committed Oct 26, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/scripts/stocks.coffee
View
@@ -0,0 +1,11 @@
+# Finance charts.
+#
+# stock me <ticker> - show today's stock chart for <ticker>
+# stock me -(5d|2w|2mon|1y) <ticker> - show stock chart for <ticker>
+
+module.exports = (robot) ->
+
+ robot.respond /stock( me)?( -(\d+\w+))? (.*)/i, (msg) ->
+ ticker = msg.match[4]
+ time = msg.match[3] || '1d'
+ msg.send "http://chart.finance.yahoo.com/z?s=#{ticker}&t=#{time}&q=l&l=on&z=l&a=v&p=s&lang=en-US&region=US#.png"

0 comments on commit 4f83e0c

Please sign in to comment.