https://gist.github.com/3437988
sms = Smsbao.new('username', 'password')
puts sms.balance
puts sms.send([15021955443,13570436426,13763338399,13719229993,15921926239],'配合群发测试,请回复:草泥马。')
puts sms.balance
users = [
{name: '温叔', mobile: 13916964187},
{name: '海威', mobile: 18626898633},
{name: '瑞林', mobile: 18602166916},
]
users.each do |user|
puts sms.send( user[:mobile], "#{user[:name]},你好:配合单发测试,请回复”我爱草泥马“。" )
end
puts sms.balance
返回:
{:success=>true, :message=>{:sent=>5, :balance=>45}}
{:success=>true, :message=>"短信队列成功", :count=>5}
{:success=>true, :message=>{:sent=>10, :balance=>40}}
{:success=>true, :message=>"短信发送成功"}
{:success=>true, :message=>"短信发送成功"}
{:success=>true, :message=>"短信发送成功"}
{:success=>true, :message=>{:sent=>13, :balance=>37}}