![]() |
2010-09-07
, 08:02
|
Posts: 11 |
Thanked: 12 times |
Joined on Sep 2007
|
#173
|
But why is Web2SMS still working without an update?
![]() |
2010-09-08
, 09:51
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#174
|
The Following User Says Thank You to blubbi For This Useful Post: | ||
![]() |
2010-09-16
, 08:55
|
|
Posts: 800 |
Thanked: 957 times |
Joined on Sep 2010
@ India
|
#176
|
run-standalne.sh python2.5 www2sms.py
class provider_160by2(provider): def getName(self): return '160by2' def hasAdvancedFeatures(self): return False def chars_per_sms(self): return 80, 80 def num_regexp(self, num): # Get rid of everything except #num = re.sub(r'[^(0-9)|\+]', '', num) num = re.sub(r'[^(0-9)]', '', num) # handle a couple of number formats (only mobile numbers allowed) #if re.search(r'^\+316\d{8}$', num): # ITU format, +31 is the Netherlands if re.search(r'^91\d{10}$', num): # 91 is India num = number[2:] return True, num, 'Valid Number-India' elif re.search(r'^965\d{8}$', num): # local dialing format num = number[:] return True, num, 'Valid Number-Kuwait' else: return False, num, 'Only India/Kuwait mobile phone numbers allowed' def sendSMS(self, MainWindow, app, NUMBER, SMSTEXT, LOGIN, PASSWORD): # TODO: check whether sending worked # TODO: handle "2 per day maximum" # TODO: localization support (at least English and Dutch) # XXX: GUI manipulation MainWindow.Stat.show() MainWindow.Stat.ui.progressBar.setMinimum(0) MainWindow.Stat.ui.progressBar.setMaximum(8) # set up our browser UpdatePbar(self, MainWindow, app, "1", "Initiating the browser") br = mechanize.Browser() cj = cookielib.LWPCookieJar() br.set_cookiejar(cj) # login try: UpdatePbar(self, MainWindow, app, "2", "Connecting to login page") br.open('http://www.160by2.com') UpdatePbar(self, MainWindow, app, "3", "Logging in") br.select_form(id='login_form') br.form['htxt_UserName'] = LOGIN br.form['txt_Passwd'] = PASSWORD br.submit() except: return False, "Error logging in" # verify our login worked and return error if not UpdatePbar(self, MainWindow, app, "4", "Checking login") br.response().read() try: br.find_link(text='Logout') except mechanize.LinkNotFoundError: return False, 'Login failed' # send the SMS UpdatePbar(self, MainWindow, app, "5", "Opening SMS page") try: #br.open('https://my.vodafone.nl/Prive/My_Vodafone/gratis_sms_versturen') br.open('http://160by2.com/compose_sms.aspx') except: return False, 'Error opening free SMS web page' UpdatePbar(self, MainWindow, app, "6", "Checking maximum SMS per day") UpdatePbar(self, MainWindow, app, "7", "Sending SMS") try: br.select_form(name='frmcompose') br.form['useremails'] = number br.form['txt_msg'] = SMSTEXT br.submit() except: print response return False, 'Error submitting SMS form' # check to see if our send worked UpdatePbar(self, MainWindow, app, "8", "Confirming SMS sent") response = br.response().read() if re.search(r'Message Sent to following Numbers', response): return True, "Provider responded: Message Sent." #elif re.search(r'Je hebt het maximum aantal gratis SMS\'jes voor vandaag verstuurd.', response): # return False, "Provider responded: Je hebt het maximum aantal gratis SMS'jes voor vandaag verstuurd." else: return False, 'Message not sent' MainWindow.Stat.close()
![]() |
2010-09-16
, 09:22
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#177
|
I tried making a new class for th indian web-to-sms site 160by2.com. I tried to add it to the source and run it from xterm with the command. But apparently, things are not as simple as that.Code:run-standalne.sh python2.5 www2sms.py
2. i will post the new class here, can you please check if it works?
[CODE]
class provider_160by2(provider):
def getName(self):
return '160by2'
def hasAdvancedFeatures(self):
return False
[...]
The Following User Says Thank You to blubbi For This Useful Post: | ||
![]() |
2010-09-16
, 11:10
|
|
Posts: 800 |
Thanked: 957 times |
Joined on Sep 2010
@ India
|
#178
|
![]() |
2010-09-16
, 11:23
|
|
Posts: 288 |
Thanked: 113 times |
Joined on Dec 2009
@ Germany
|
#179
|
![]() |
2010-09-16
, 14:54
|
|
Posts: 800 |
Thanked: 957 times |
Joined on Sep 2010
@ India
|
#180
|
num = number[3:]
Currently my head is up in paperwork, publications and talks... sorry guys, but it is not gonna happen this week.
Installing old versions does not help, since something on the website must have changed (rough guess, since I didn't change the o2online.de class)
Sorry again.
Cheers
Bjoern
My website:
- olausson.de
- gallery.olausson.de
My Applications: