Notices


Reply
Thread Tools
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#231
Originally Posted by ejasmudar View Post
this is what i get from desktop-chrome as well as microB.

EDIT: but this works http://m.160by2.com/index.asp?in=yes. Can you please change the provider file?
I'll catch that, but I need the exceptionthrown by mechanize.

Could you please change the code in www2sms_providers.py:

Code:
return error(self, MainWindow, e, "Step 2: Failed to open site")
to
Code:
return error(self, MainWindow, e, "Step 2: Failed to open site\n%s\n%s" %(e, type(e)))
This should be on line 1192.
(in /home/user/MyDocs/www2sms/www2sms_providers_web.py)

Cheers
Bjoern
 

The Following User Says Thank You to blubbi For This Useful Post:
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#232
I have modified the file in home to http://m.160by2.com/index.asp?in=yes and successfully sent sms. Now I am modding the script for things like only 80 chars for intl sms, etc and will upload it here later. Thanks Bjoern!
 
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#233
Originally Posted by blubbi View Post
I'll catch that, but I need the exceptionthrown by mechanize.

Could you please change the code in www2sms_providers.py:
Do you still need me to do this? Also did u mean www2sms_providers.py or www2sms_providers_web.py?
 
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#234
Originally Posted by ejasmudar View Post
Do you still need me to do this? Also did u mean www2sms_providers.py or www2sms_providers_web.py?
When you update the providers module it is placed in "/home/user/MyDocs/www2sms/" and is called www2sms_providers_web.py

Yes, please tell me the exception which will be displayed.

You can also just remove the try: except: statement around br.open() then mechanize will fail and print the error to the console.

or just fire up python or ipyhon and type the following:

Code:
import mechanize
br = mechanize.Browser()
br.open(http://m.160by2.com/)
If it works it looks something like that (when using ipython)
Code:
In [15]: br.open("http://m.160by2.com/")
Out[15]: <response_seek_wrapper at 0x8660fac whose wrapped object = <closeable_response at 0x865e86c whose fp = <socket._fileobject object at 0x8604dac>>>
if it fails:

Code:
In [16]: br.open("http://m.160by2XYZ.com/")
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (163, 0))

---------------------------------------------------------------------------
URLError                                  Traceback (most recent call last)
I need to know how exactly mechanize fails.

Cheers
Bjoern
 

The Following User Says Thank You to blubbi For This Useful Post:
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#235
This is the error I get
Code:
>>> br.open("http://m.160by2.com")

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/mechanize/_mechanize.py", line 203, in open
return self._mech_open(url, data, timeout=timeout)
File "/usr/lib/python2.5/site-packages/mechanize/_mechanize.py", line 255, in _mech_open
raise response
mechanize._response.httperror_seek_wrapper: HTTP Error 404: Not Found
 
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#236
updated provider module to 1.1.1 which should fix your problem but in a more generic way.

It tries to load http://m.160by2.com/ if this results in an HTTPError it tries to load http://m.160by2.com/index.asp?in=yes

It might be necessary to do the same for all of the supported countries:
India, Kuwait, UAE, Saudi, Singapore, Philippines & Malaysia

But from Germany it works with the default URL http://m.160by2.com/

Cheers
Bjoern
 

The Following 2 Users Say Thank You to blubbi For This Useful Post:
plaban's Avatar
Posts: 395 | Thanked: 107 times | Joined on Dec 2009 @ India
#237
160by2 works perfectly,but why only 80 characters? 160by2 supports 140 characters.
__________________
Nokia N900: It's a computer with a phone, not a phone that can compute.


Web Advices
Tablet Phone X
Blogging Tips
Know IP Address
 
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#238
Originally Posted by plaban View Post
160by2 works perfectly,but why only 80 characters? 160by2 supports 140 characters.
On the help page they are talking about 80 chars:
http://m.160by2.com/About_160by2.asp?l=1
160by2 allows YOU to send Free SMS up to 80 characters long which can reach any mobile in India. Rest of the 80 characters will be utilized by contextual advertisement.
160by2 = 80 for YOU + 80 for Advertisers.
 
ejasmudar's Avatar
Posts: 800 | Thanked: 957 times | Joined on Sep 2010 @ India
#239
I am uploading a slightly modified version of the 160by2 provider. Changes include
-140 characters limit (only 80 for international, but not implemented yet)
-Removes leading 0 (Domestic) or 00 (international) if any
-Checks if number begins with 9,8,7 or 6 (requisite for Indian mobile numbers and intl' calling codes for supported countries)
-First goes to http://m.160by2.com/index.asp?in=yes instead of http://m.160by2.com so as to save time.

Please test and comment if there are any bugs in this. I have tried only international sms to Kuwait. But it was not working (not the app's problem. something wrong with their site). So please check others and let me know if it is successful.

PS: i can't upload py file here. Also txt file is too big to be uploaded here, apparently (huh?). So i have zipped it and uploaded it.
Attached Files
File Type: zip www2sms_providers_web.zip (11.4 KB, 159 views)

Last edited by ejasmudar; 2010-11-22 at 05:52.
 
blubbi's Avatar
Posts: 288 | Thanked: 113 times | Joined on Dec 2009 @ Germany
#240
Originally Posted by ejasmudar View Post
I am uploading a slightly modified version of the 160by2 provider. Changes include
-140 characters limit (only 80 for international, but not implemented yet)
-Removes leading 0 (Domestic) or 00 (international) if any
-Checks if number begins with 9,8,7 or 6 (requisite for Indian mobile numbers and intl' calling codes for supported countries)
-First goes to http://m.160by2.com/index.asp?in=yes instead of http://m.160by2.com so as to save time.

Please test and comment if there are any bugs in this. I have tried only international sms to Kuwait. But it was not working (not the app's problem. something wrong with their site). So please check others and let me know if it is successful.

PS: i can't upload py file here. Also txt file is too big to be uploaded here, apparently (huh?). So i have zipped it and uploaded it.
You could have used diff to send me the changes ;-)

Changes accepted and published.

hit update to get the latest and greatest ;-)

Thanks,
Bjoern
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 02:35.