[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] sending IM to gmail chat



PureBytes Links

Trading Reference Links

here is a peice of code that will do it. i am not sure if there is a 
better way of triggering a windows executable than alertif. if so let 
me know.

trigger=ParamTrigger( "Want to send email", "SEnd IM");
if(trigger){
_TRACE("sending alerts");
AlertIf(True, "exec c:\\youpath\\sendIM.rb"," sending alert",0,1);
}
 
_SECTION_END();

to run this you need, 
1. Ruby(free)
2. 'xmpp4r/client' gem.(free)

SendIM.rb is below
require 'xmpp4r/client'
include Jabber # Makes using it a bit easier as we don't need to 
prepend Jabber:: to everything
# Jabber::debug = true # Uncomment this if you want to see what's 
being sent and received!


def sendMessage(subject,body)
jid = JID::new('warriortrader51@xxxxxxxxx')
password = 'qazwsx123'
	begin


		cl = Client::new(jid)
		cl.connect
		cl.auth(password)
		to = "junkone1@xxxxxxxxx"
		
		
		m = Message::new(to, subject + "\n" + body).set_type
(:normal).set_id('1').set_subject(subject)
		cl.send m


	end
end
if(nil|ARGV[0]) then
	sendMessage("Scan Alert" , ARGV[0])
end




------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/