Created
March 17, 2016 15:57
-
-
Save ragingbal/e28595bf2ed05ce44dd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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