Skip to content

Instantly share code, notes, and snippets.

@ragingbal
Created March 17, 2016 15:57
Show Gist options
  • Select an option

  • Save ragingbal/e28595bf2ed05ce44dd7 to your computer and use it in GitHub Desktop.

Select an option

Save ragingbal/e28595bf2ed05ce44dd7 to your computer and use it in GitHub Desktop.
import requests
apiurl="http://abc,xyz"
clientId = "471"
password = "hshsh"
sourceMsisdn = "hshsh"
messageText="Get your latest mobile games here"
count = 0
with open('list.csv') as f:
content = f.readlines()
for theline in content:
destinationMsisdn = theline[0:12].rstrip()
operatorId=theline[13:15].rstrip()
requestId='play_' + destinationMsisdn
payload = {'clientId':clientId,'password':password,'sourceMsisdn':sourceMsisdn,'operatorId':operatorId,'destinationMsisdn':destinationMsisdn,'messageText':messageText,'requestId':requestId}
r = requests.get(apiurl, params=payload)
print(r.url)
print( r.content)
count = count+1
print str(count) + ' messages sent'
print 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment