
SMS Widget
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
SMS Widget is a Plasmoid written in Ruby.
Right now it just supports a few providers, but it is planned to add more online sms services. I'd be glad if any of you added any code for your provider. The more the better.
Installation
Kubuntu (9.04):
sudo aptitude install libkorundum4-ruby1.8 libhttp-access2-ruby1.8
Fedora:
sudo yum install korundum
11 years ago
0.2 - May, 20th 2009
- major code cleanups and UI improvements
- more providers:
--- voipcheap.com
--- coop.ch
--- mbudget.ch
--- swisscom.ch
0.1 - May, 7th 2009:
- initial release.
11 years ago
0.2 - May, 20th 2009
- major code cleanups and UI improvements
- more providers:
--- voipcheap.com
--- coop.ch
--- mbudget.ch
--- swisscom.ch
0.1 - May, 7th 2009:
- initial release.
postadelmaga
9 years ago
I have all the stuff installed but it doesn't work :)
However I'll wait for the new js version
Bye
Report
postadelmaga
9 years ago
on kde 4.5 ubuntu Maverick I got this message:
could not create ruby script engine ....
i have installed
- libkde4-ruby1.8 ( actual substitute for libkorandum-ruby1.8 )
- libhttpclient-ruby1.8
as described by the author
any hint ?
Report
nethad
9 years ago
A few weeks ago I started a rewrite of the SMS Widget in JavaScript, because I had limitations using Ruby. In JavaScript, however, the number autocompletion feature does not work and I haven't written a workaround yet.
I'll post updates as soon as there is a usable version.
Report
malfi
10 years ago
$ cat ~/.kde/share/apps/plasma/plasmoids/sms-widget/contents/code/providers/arcor_de.rb
require 'net/http'
require 'net/https'
require 'uri'
module Provider
class ArcorDE < AbstractProvider
@sms_sender
@login_name
@password
def initialize(sms_sender)
@sms_sender = sms_sender
@login_name = @sms_sender.get_main.login_name
@password = @sms_sender.get_main.password
end
def send(to, text)
use_ssl = 1
trans =Iconv.new('ISO-8859-1','UTF-8') # new converter-object encoding from UTF-8 to ISO-8859-1
text=URI.escape(trans.iconv(text)) # convert message to ISO-8859-1 and escape it for use in URL
#SmsWidget::Main.logger.debug "login = #{@login_name}\npassword = #{@password}\nto = #{to}\ntext = #{text}\nuse_ssl = #{use_ssl}"
# URLs
referer_url = 'https://www.arcor.de/login/login.jsp'
login_url = 'https://www.arcor.de/login/login.jsp'
send_url = 'https://www.arcor.de/ums/ums_neu_sms.jsp'
# Settings
user_agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
redirect = ''
cookie = ''
if use_ssl
port = 443
else
port = 80
end
# Now do the login
login_uri = URI.parse(login_url)
http = Net::HTTP.new(login_uri.host, port)
http.ca_path = "/etc/ssl/certs"
http.use_ssl = use_ssl
post_data = "user_name=#{@login_name}&password=#{@password}&login=Login&goto=&protocol=https"
post_headers = { 'Referer' => referer_url, 'Cookie' => cookie, 'Content-Type' => 'application/x-www-form-urlencoded'}
resp, data = http.post(login_uri.path, post_data, post_headers)
cookie = resp.response['set-cookie'].split('; ')[0]
SmsWidget::Main.logger.info 'accepted cookie: ' + cookie
#resp.each { |key, val|
# SmsWidget::Main.logger.debug "#{key} => #{val}"
#}
while redirect = resp.response['location'] do
SmsWidget::Main.logger.info 'redirected to: ' + redirect
resp = http.get(redirect, {'Cookie' => cookie})
end
#SmsWidget::Main.logger.debug "arcor de login data: #{resp.body}"
if resp.body.include? 'Der Login ist fehlgeschlagen'
raise InvalidPasswordOrUsernameException
end
#now we can send the message
send_uri = URI.parse(send_url)
http = Net::HTTP.new(send_uri.host, port)
http.use_ssl = use_ssl
post_data = "emailAdressen=#{@login_name}%40arcor.de&useOwnMobile=on&empfaengerAn=#{to}&nachricht=#{text}&gesendetkopiesms=on&senden=Senden&firstVisitOfPage=foo&ordnername=Posteingang&part=0"
post_headers = { 'Referer' => login_url, 'Cookie' => cookie, 'Content-Type' => 'application/x-www-form-urlencoded'}
sent=false
#resp, data = http.post(send_uri.path, post_data, post_headers)
resp = http.post(send_uri.path, post_data, post_headers)
while redirect = resp.response['location'] do
SmsWidget::Main.logger.info 'redirected to: ' + redirect
resp = http.get(redirect, {'Cookie' => cookie})
end
if resp.body.include? 'Die SMS wurde im Gesendet-Ordner gespeichert'
#exit 0
sms_sent()
sent=true
end
unless sent
sms_not_sent("something went wrong")
end
end
end
end
Quote:
$ tail -n 15 ~/.kde/share/apps/plasma/plasmoids/sms-widget/contents/code/provider_list.yml
class: OrangeCH
icon: orangech.png
password_needed: true
own_number_needed: false
arcor.de:
login_needed: true
help: Enter your login name and your password.
class: ArcorDE
icon: orangech.png
password_needed: true
own_number_needed: false
"":
login_needed: true
password_needed: true
own_number_needed: false
Report
nethad
9 years ago
Report
jschultz
11 years ago
Report
SilvaRizla
11 years ago
Report
weinfurt
11 years ago
So i need two steps sending proces, forst get captcha picture, show that picture for user and than send data to URL with letters from captcha picture filled by user.
is that explanation clear ? Is there anyone would help ?
Thanks
Michal
Report
futal
11 years ago
Basically, requesting the following page send the SMS. The answer tells if the SMS was successfully sent.
https://myaccount.VoipCheap.com/clx/sendsms.php?username=xxx​ &password=xxx&from=xxx&to=xxx&text=xxx
* username: your VoipCheap username
* password: your VoipCheap password
* from: your username or your verified phone number in international format (starting with a plus).
* to: destination number in international format (starting with +). I guess several number can be entered with commas. To be checked.
* text: the message you want to send.
It should work similarly with many other providers.
Report
nethad
11 years ago
voipcheap.com support is currently in the making. It should work but I couldn't test it yet. There will soon be a new version.
Report
nethad
11 years ago
To install the widget, you could go to the "Add Widgets" dialog (right click on your desktop), there you choose "Install New Widgets" -> "Download New Plasma Widgets".
Or you download the sms-widget.plasmoid here and install it via command line:
plasmapkg -i sms-widget.plasmoid
Report
zalbinosek
11 years ago
Report
nethad
11 years ago
Report
futal
11 years ago
Currently, I haven't found an easy way to install Ruby support in Kubuntu. It exists in Debian Sid with plasma-scriptengine-ruby package. Yet installing this package in Ubuntu would require risky changes in base packages.
Report
nethad
11 years ago
http://packages.ubuntu.com/search?keywords=korundum&searchon=names&suite=jaunty§ion=all
shows me, that there's the "libkorundum4-ruby1.8" package. Does it work with that package? If so, I'll add it as a hint in the description.
Report
futal
11 years ago
Your SmsWidget also needs the installation of "libhttp-access2-ruby1.8" (plus dependencies) to work. This comes from the "require net/https" header.
In short, for Kubuntu 9.04:
sudo aptitude install libkorundum4-ruby1.8 libhttp-access2-ruby1.8
Report
Thule
11 years ago
Thanks in advance!
Report
nethad
11 years ago
Report
zalbinosek
11 years ago
Report
nethad
11 years ago
Report