def get_telegram_slots(self): #getting free slots (count available phone numbers for each services) available_phones = GetFreeSlots( country=SmsTypesPlus.Country.PA).request(self.wrapper) print('Telegram: {} available'.format(available_phones.Telegram.count)) return available_phones.Telegram.count
import os, sys import configparser import csv import time """ create wrapper with secret api-keysearch here: http://sms-activate.ru/index.php?act=profile) """ wrapper = Sms('59f99Af3754fd7c9b5dA932840473d0A') # getting balance balance = GetBalance().request(wrapper) # show balance print('На счету {} руб.'.format(balance)) # getting free slots (count available phone numbers for each services) available_phones = GetFreeSlots(country=SmsTypes.Country.UA).request(wrapper) # show for vk.com, whatsapp and youla.io) print('Telegram: {} номеров'.format(available_phones.Telegram.count)) # try get phone for youla.io activation = GetNumber( service=SmsService().Telegram, country=SmsTypes.Country.UA, #operator=SmsTypes.Operator.Beeline ).request(wrapper) print('id: {} phone: {}'.format(str(activation.id), str(activation.phone_number))) # getting and show current activation status response = GetStatus(id=activation.id).request(wrapper)
""" wrapper = Sms('API KEY', 'http://sms-activate.api.5sim.net/stubs/handler_api.php') # ------------------------------ # # getting balance balance = GetBalance().request(wrapper) # show balance print('На счету {} руб.'.format(balance)) # ------------------------------ # # getting free slots (count available phone numbers for each services) available_phones = GetFreeSlots( country=SmsTypes.Country.RU, operator=SmsTypes.Operator.TELE2).request(wrapper) # show for vk.com, whatsapp and youla.io) print('vk.com: {} номеров'.format(available_phones.VkCom.count)) print('whatsapp: {} номеров'.format(available_phones.Whatsapp.count)) print('youla.io: {} номеров'.format(available_phones.Youla.count)) # ------------------------------ # # try get phone for youla.io activation = GetNumber(service=SmsService().Youla, country=SmsTypes.Country.RU, operator=SmsTypes.Operator.Beeline).request(wrapper) # show activation id and phone for reception sms print('id: {} phone: {}'.format(str(activation.id),