· 5 years ago · Oct 15, 2020, 01:44 PM
1import requests
2import json
3from twilio.rest import Client
4import time
5import datetime
6print(r"""
7 _ _ _ _ ___ ___ _ ___ _____ ___
8 /_\ | \| | /_\ | _ \/ __| || \ \ / / _ / _ \
9 / _ \| .` |/ _ \| | (__| __ |\ V /\_, \_, /
10 /_/ \_|_|\_/_/ \_|_|_\\___|_||_| |_| /_/ /_/
11 Twilio Get Balance And phone number
12 john.dhoe412@gmail.com
13 https://www.facebook.com/jancoxx412
14 """)
15account_sid = raw_input(" [+] Input your Twilio account sid : ")
16auth_token = raw_input(" [+] Input your Twilio Auth Key : ")
17time.sleep(1)
18print " [+] Checking ...."
19time.sleep(1)
20
21
22def get_balance():
23 r = requests.get('https://api.twilio.com/2010-04-01/Accounts/'+account_sid+'/Balance.json', auth=(account_sid, auth_token))
24 Json = json.dumps(r.json())
25 resp = json.loads(Json)
26 balance = resp ['balance']
27 currency = resp ['currency']
28 return str(balance)+' '+str(currency)
29
30def get_phone():
31 client = Client(account_sid, auth_token)
32 incoming_phone_numbers = client.incoming_phone_numbers.list(limit=20)
33 for record in incoming_phone_numbers:
34 return record.phone_number
35def get_type():
36 client = Client(account_sid, auth_token)
37 account = client.api.accounts.create()
38 return account.type
39
40def send_sms():
41 try:
42 phone = get_phone()
43 client = Client(account_sid, auth_token)
44 message = client.messages.create(
45 body='Gendeng Squad - SUCCES SEND TWILIO',
46 from_= phone,
47 to='+17852684740'
48 )
49 return message.status
50 except:
51 return 'die'
52
53def result():
54 try:
55 date = datetime.datetime.now().strftime('%Y-%m-%d')
56 balance = get_balance()
57 number = get_phone()
58 type = get_type()
59 send = send_sms()
60 if send == 'die':
61 status = 'CANT SEND SMS'
62 else:
63 status = 'LIVE'
64 print "================================================"
65 print " [+] STATUS : {}".format(str(status))
66 print " [+] Account SID : {}".format(str(account_sid))
67 print " [+] Auth Key : {}".format(str(auth_token))
68 print " [+] Balance : {}".format(str(balance))
69 print " [+] Phone Number list : {}".format(str(number))
70 print " [+] Account Type : {}".format(str(type))
71 print " [+] Gendeng Squad Twilio Checker"
72 print "================================================"
73 open('twilio_result '+date+'.txt','a').write("[+] STATUS : {}\n[+] Account SID : {}\n[+] Auth Key : {}\n[+] Balance : {}\n[+] Phone number list : {}\n[+] Account Type : {} \n".format(str(status),str(account_sid),str(auth_token),str(balance),str(number),str(type)))
74 except:
75 print " [+] Api Invalid"
76
77result()