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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s