def main(): voice = Voice() email = input("email: ") password = getpass.getpass() # input("password: "******"phone number to send sms to: ") voice.login(email, password) voice.send_sms(number, "pygooglevoice-sms") voice.logout()
class GoogleVoiceSMSNotificationService(BaseNotificationService): """Implement the notification service for the Google Voice SMS service.""" def __init__(self, username, password): """Initialize the service.""" from googlevoicesms import Voice self.voice = Voice() self.username = username self.password = password def send_message(self, message="", **kwargs): """Send SMS to specified target user cell.""" targets = kwargs.get(ATTR_TARGET) if not targets: _LOGGER.info('At least 1 target is required') return if not isinstance(targets, list): targets = [targets] self.voice.login(self.username, self.password) for target in targets: self.voice.send_sms(target, message) self.voice.logout()
def __init__(self, username, password): """Initialize the service.""" from googlevoicesms import Voice self.voice = Voice() self.username = username self.password = password
def __init__(self, username, password): from googlevoicesms import Voice self.voice = Voice() self.username = username self.password = password