SMS Widget

Plasma 4 Extensions

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

1
7 .9
Description:

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
Last changelog:

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

Thank you for soon replay

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

- Problem

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

C

nethad

9 years ago

I personally run Fedora, so I can't test the widget with Kubuntu. Generally QtRuby must be installed including kde ruby bindings.

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

9 years ago

Quote:
$ 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

C

nethad

9 years ago

I forgot to answer you, sorry. Thanks for the code! See my post below concerning the rewrite in JavaScript. I'll try to port your code.

Report

jschultz

11 years ago

Any chance you could improve the configurability by making an option for an external script to be called to do the actual sending?

Report

SilvaRizla

11 years ago

Does anyone have a UK provider for this and instructions on how to integrate it?

Report

weinfurt

11 years ago

I would like to add my provider, but i;m not familiar with rubby. As i seen in others provider files, it is not too complicated, but ! My privider needs to fill captcha form instead of login to site.

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

It is explained here how to send SMS using HTML with a VoipCheap account: http://www.voipcheap.com/en/sms_instructions.html

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

C

nethad

11 years ago

Sorry for the late answer:
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

C

nethad

11 years ago

Thanks! :)
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

I tried installing it from a local file, but didn't work. then i downloaded it from web by the same add widget dialog, but there were errors again.... it just says it cannot be installed or it's not a plasma package..

Report

C

nethad

11 years ago

What was the error when you tried it from a local file?

Report

futal

11 years ago

Installation doesn't work with Kubuntu 9.04 (Jaunty Jackalope) because only Python support is installed for Plasma widget.

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

C

nethad

11 years ago

I can't speak for Ubuntu, but in Fedora the package needed is called "korundum". A quick inquiry on packages.ubuntu.com

http://packages.ubuntu.com/search?keywords=korundum&searchon=names&suite=jaunty&section=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

Indeed, in order to have Ruby Plasmoids working with Kubuntu 9.04, you need to install "libkorundum4-ruby1.8" (plus dependencies).

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

Does anybody know which files I have to install under openSuse 11.1? I cannot find any *korundum* file!

Thanks in advance!

Report

C

nethad

11 years ago

Thank you! I added a hint in the description.

Report

zalbinosek

11 years ago

great idea! i've been waiting for someone like this,but how do I install it?. i have no idea of writing a code, but if you could explain me, i'd try to write plugins for Polish operators.

Report

C

nethad

11 years ago

Hi, the message below this is meant for you :) I clicked the wrong link.

Report

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.

12345678910
10
product-maker bioingHP Sep 01 2011 9 excellent
product-maker srijan4 Aug 13 2011 9 excellent
product-maker Arstan Aug 06 2011 9 excellent
product-maker olo81 Jul 13 2011 9 excellent
product-maker CyberAng3l Jun 06 2011 9 excellent
product-maker JeremiahMosser Jun 01 2011 9 excellent
product-maker sandipanmohanty Apr 18 2011 9 excellent
product-maker shramang Mar 26 2011 9 excellent
product-maker PhrkOnLsh Feb 10 2011 9 excellent
product-maker gehriga Feb 10 2011 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
zalbinosek
Sep 15 2010
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.2
updated May 20 2009
added May 07 2009
downloads 24h
0
mediaviews 24h 0
pageviews 24h 3