Our Little Hacky Ruby Api for sms-one.de

require 'open-uri'
host = "http://sms-one.de"
body = open("#{host}/login.php4?kundennummer=#{username}&passwort=#{password}").read
session = body.match(/\?sid=(.*?)"/)[1]
body = open("#{host}/navi.php4?sid=#{session}").read
credit = body.match(/Guthaben: (.*?) /)[1]
puts "Your current credit is #{credit}€"

Leave a comment