Skip to content

Commit

Permalink
Fixes for forthnet and otenet account. Thanks to George Papamichelakis
Browse files Browse the repository at this point in the history
  • Loading branch information
Markos Chandras committed Mar 4, 2012
1 parent 92b0245 commit 05359d7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pysmssendmod/cmdfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ def creditsleft(account,foobar,verbose):
temp1=dataline.split("""class="txtmov10b_yellow">""")
temp2=temp1[1]
left=temp2.split("</span>")
final=str(5-int(left[0]))
final=str(int(left[0]))
elif account=="forthnet":
gethtml=foobar.response()
html=gethtml.read()
balance=html.find("<span id=\"SentItems1_lbPerDay\">")
balance=html.find("<span id=\"SentItems2Phase1_lbPerMonth\">")
balanceline=html[balance:]
temp1=balanceline.split("<span id=\"SentItems1_lbPerDay\">")
temp1=balanceline.split("<span id=\"SentItems2Phase1_lbPerMonth\">")
temp2=temp1[1].split("</span>")
temp3=temp2[0].split("/");
final=str(5-int(temp3[0]))
print temp3
final=str(int(temp3[0]))
#final is the amount of money we have :)
return final
#############################################################################
Expand Down Expand Up @@ -169,7 +170,7 @@ def sendsmscmd(account,username,password,number,message,verbose,leftcred):
html=gethtml.read()
balance=html.find("<span id=\"lbPerDay\">")
balanceline=html[balance:]
temp1=balancelinie.split("<span id=\"lbPerDay\">")
temp1=balanceline.split("<span id=\"lbPerDay\">")
temp2=temp1[1].split("</span>")
temp3=temp2[0].split("/");
leftcred2=str(5-int(temp3[0]))
Expand All @@ -183,11 +184,12 @@ def sendsmscmd(account,username,password,number,message,verbose,leftcred):
if verbose:
print "Sending..."
req = urllib2.Request(acc_opensms2[str(account)], data, headers)
#its not my fault if betamax sends wrong reports
response=urllib2.urlopen(req)
#small delay
pass
pass
pass
#its not my fault if betamax sends wrong reports
response=urllib2.urlopen(req)
report=response.read()
#lets find out if the message was sent correctly
data_response1=report.find("<resultstring>")
Expand Down

0 comments on commit 05359d7

Please sign in to comment.