Created
October 14, 2014 20:05
-
-
Save lippytak/11067a73e757d64e3ab6 to your computer and use it in GitHub Desktop.
This file contains 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
from twilio.rest import TwilioRestClient | |
import re | |
# Your Account Sid and Auth Token from twilio.com/user/account | |
account_sid = 'hi' | |
auth_token = 'there' | |
client = TwilioRestClient(account_sid, auth_token) | |
bads = [] | |
# A list of transcription objects with the properties described above | |
# transcriptions = client.transcriptions.list(page_size = 1000) | |
regex = re.compile(r'\$.*\s') | |
for t in client.transcriptions.iter(): | |
text = t.transcription_text | |
amount = '' | |
try: | |
amount_str = re.search('\S*(\$\d+\.\d\d)', text).group(1) | |
amount = int(amount_str.split('.')[0][1:]) | |
except: | |
pass | |
if amount and amount > 1000: | |
recording = client.recordings.get(t.recording_sid) | |
print '%s | %s' % (amount_str, recording.uri + '.mp3') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment