Example #1
0
def login():
    username, password = "******", "314159Gmail"

    voice = Voice()
    client = voice.login(username, password)
    client.call('+8618623001528')
    return client
Example #2
0
class GoogleVoice:
    def __init__(self, email, password):
        self.handle = Voice()
        self.handle.login(email, password)

    def send(self, dstNumber, msg):
        self.handle.send_sms(dstNumber, msg)
Example #3
0
def TogglePhones(log_file, actions):
  voice = Voice()
  voice.login()
  exceptions = []
  for phone in voice.phones:
    if phone.phoneNumber in REVERSE_NUMBERS:
      phone_name = REVERSE_NUMBERS[phone.phoneNumber]
      if phone_name in actions:
        action = actions[phone_name]
        try:
          if action.state == phones_pb2.Action.ENABLED:
            prefix = 'Enabling'
            phone.enable()
          else:
            prefix = 'Disabling'
            phone.disable()
          print '%s %s: %s for change at %s' % (
              prefix, phone_name, phone.phoneNumber,
              util.FormatTime(action.time_ms))
        except Exception as e:
          print e
          exceptions.append(e)
  voice.logout()
  if exceptions:
    raise Exception(exceptions)
Example #4
0
def run():
    received_messages = []
    delay_time = 7  # time in seconds to wait between message checks
    response_message = "Hello Human! \n You will now receive the Zine Prologue. When finished, you may proceed to enter the Zine\n It works best with headphones. \n https://drive.google.com/file/d/1AKW5qbpcqbbVzaICtkejU0DBrW9HlIdb/view?usp=sharing"  # your autoreply message
    voice = Voice()
    login(voice)  # login will prompt for email/password in the command line
    print('Running...\nPress ctrl C to quit')

    while True:
        # get messages
        try:
            for msg in voice.sms().messages:
                if not msg.isRead:
                    # log to the console
                    print("{} >> {}".format(time.strftime('%x %X'),
                                            msg.phoneNumber))
                    # reply
                    voice.send_sms(msg.phoneNumber, response_message)
                    msg.mark(1)
        except KeyboardInterrupt:
            raise
        except:
            print("Unexpected error:", sys.exc_info()[0])

        time.sleep(delay_time)
Example #5
0
class Google_Voice(StateDevice):
    STATES = [State.UNKNOWN, State.ON, State.OFF]
    COMMANDS = [Command.MESSAGE]

    def __init__(self, user=None, password=None, *args, **kwargs):
        self._user = user
        self._password = password
        print "big"
        self._create_connection(user, password)
        super(Google_Voice, self).__init__(*args, **kwargs)

    def _create_connection(self, user, password):
        print "ehehe"
        self._voice = Voice()
        print 'user' + user + ":" + password
        self._voice.login(email=user, passwd=password)

    def _initial_vars(self, *args, **kwargs):
        super(Google_Voice, self)._initial_vars(*args, **kwargs)

    def _delegate_command(self, command, *args, **kwargs):
        self._logger.debug('Delegating')
        print 'pie'
        print str(args) + ":" + str(kwargs)
        if isinstance(command, tuple) and command[0] == Command.MESSAGE:
            self._logger.debug('Sending Message')
            self._voice.send_sms(command[1], command[2])

        super(Google_Voice, self)._delegate_command(command, *args, **kwargs)
Example #6
0
def run():
    voice = Voice()
    voice.login()

    for message in voice.sms().messages:
        if message.isRead:
            message.delete()
Example #7
0
def returnmessage(phone):
    response = open('response.txt', 'r')
    message = response.readline()
    gvoice = Voice()
    gvoice.login()
    gvoice.send_sms(phone, message)
    response.close()
Example #8
0
def run():
    voice = Voice()
    voice.login()
    for msg in voice.sms().messages:
        if msg.phoneNumber == "+13145918660":
            msg.mark(0)
            print('marked')
Example #9
0
def start_crawl():
    """
        Run this to begin the crawl!
        Keep in mind participants form must have this format: Timestamp (google adds this automatically), Name, and phone number
        Keep in mind hosts form must have this format: Stop College, Location, Drink Name
        ** Also, your password to your google account will be echoed on the command line. **
        
        If you are not on Aaron's computer and are looking to get the necessary python packsages... you need:
            pygooglevoice
            gdata-python-client
            BeautifulSoup
        
        Happy crawling!
    """
    email = raw_input('What is your Google Account?') # voice and docs must be same acct
    password = raw_input('What is your Google Password')
    hosts_name = raw_input('What is the name of your GoogleDocs Host Spreadsheet')
    participants_name = raw_input('What is the name of your GoogleDocs Participants Form')
    _organizer_number = raw_input('What is the phone number of the crawl organizer? (10 digit number)')
    organizer_number = '+1'+_organizer_number+':'
    num_stops = raw_input('What is the number of stops')
    
    gd_client = gdata.spreadsheet.service.SpreadsheetsService()
    gd_client.email = email
    gd_client.password = password
    gd_client.source = 'Insta-Crawl'
    gd_client.ProgrammaticLogin()
    
    hosts = _getSpreadsheetRows(hosts_name, gd_client)
    participants = _getSpreadsheetRows(participants_name, gd_client)
    
    voice = Voice()
    voice.login(email, password)
    
    _start_poll(organizer_number, hosts, participants, num_stops, voice)
Example #10
0
class Google_Voice(StateDevice):
    STATES = [State.UNKNOWN, State.ON, State.OFF]
    COMMANDS = [Command.MESSAGE]

    def __init__(self, user=None, password=None, *args, **kwargs):
        self._user = user
        self._password = password
        self._create_connection(user, password)
        super(Google_Voice, self).__init__(*args, **kwargs)

    def _create_connection(self, user, password):
        self._voice = Voice()
        self._logger.debug('user' + user + ":" + password)
        self._voice.login(email=user, passwd=password)

    def _initial_vars(self, *args, **kwargs):
        super(Google_Voice, self)._initial_vars(*args, **kwargs)

    def _delegate_command(self, command, *args, **kwargs):
        self._logger.debug('Delegating')
        self._logger.debug(str(args) + ":" + str(kwargs))
        if isinstance(command, tuple) and command[0] == Command.MESSAGE:
            self._logger.debug('Sending Message')
            self._voice.send_sms(command[1], command[2])

        super(Google_Voice, self)._delegate_command(command, *args, **kwargs)
Example #11
0
class Connection(SuperConn):
    """Manages connection with Google Voice"""
    
    def get_messages(self):
        """Retrieve messages from GV connection and return MessageSet instance"""
        return gv_convos_to_messages(self)
        
    def send(self,msg):
        """Send a message using this GV connection."""
        #Should we check if it's sending a message to itself?
        
        self.check_num_format(msg.to_num) #raises exception if not right format
        
        self.voice.send_sms(msg.to_num,msg.text)
        
    def __init__(self,cid,**creds):
        """Connection to Google Voice.
        optional keyword args:
            GV_USER=<str>, GV_PASSWORD=<str>
        (if none provided will prompt)"""
        
        self.voice = Voice()
        print "logging in to GV account %s" % creds['GV_USER']
        self.voice.login(email=creds['GV_USER'],passwd=creds['GV_PASSWORD'])
        self.id = cid
        self.num = self.voice.settings['primaryDid']
        self.backend = 'pygooglevoice'
        
    def __delete__(self):
        self.voice.logout()
Example #12
0
def run():
    voice = Voice()
    voice.login()

    voice.sms()
    for msg in extractsms(voice.sms.html):
        print(msg)
Example #13
0
  def post(self):
    if users.get_current_user() is None:
      self.redirect('/')

    key = self.request.get('id', '')
    if key == '':
      self.error(400)
      return

    try:
      phone = Phone.all().filter('user ='******'__key__ =', db.Key(key)).get()

      phone.code = Phone.generate_code()
      phone.code_time = datetime.datetime.now()
      phone.put()

      v = Voice()
      v.login()
      v.send_sms(phone.number, phone.code)

    except db.BadKeyError:
      self.error(400)
      return;
      
    self.redirect('/phone/verify?id=%s' % key)    
Example #14
0
def run():
    voice = Voice()
    voice.login()

    phoneNumber = input('Number to send message to: ')
    text = input('Message text: ')

    voice.send_sms(phoneNumber, text)
Example #15
0
def main(number, message):
  voice = Voice();

  email = '*****@*****.**';
  password = '******';
  voice.login(email, password);

  voice.send_sms(number, message);
Example #16
0
def run():
    voice = Voice()
    voice.login()

    folder = voice.search(input('Search query: '))

    print('Found %s messages: ', len(folder))
    pprint.pprint(folder.messages)
Example #17
0
 def __init__(self, pluginId, pluginDisplayName, pluginVersion,
              pluginPrefs):
     indigo.PluginBase.__init__(self, pluginId, pluginDisplayName,
                                pluginVersion, pluginPrefs)
     self.debug = pluginPrefs.get("showDebugInfo", False)
     self.deviceList = []
     self.shutdown = False
     self.voice = Voice()
Example #18
0
def sendsms(message):
    voice = Voice()
    voice.login()

    phoneNumber = input('YOURNUMBER')
    text = input(str(message))

    voice.send_sms(phoneNumber, text)
Example #19
0
def run():
    download_dir = '.'

    voice = Voice()
    voice.login()

    for message in voice.voicemail().messages:
        message.download(download_dir)
Example #20
0
def run():
	voice = Voice()
	voice.login()

	folder = voice.search(input('Search query: '))

	print('Found %s messages: ', len(folder))
	pprint.pprint(folder.messages)
 def __init__(self, email, password):
     self.voice = Voice()
     self.email = email
     self.password = password
     self.numbers = []
     self.interests = []
     self.profile = config.Standby
     self.status = HsaStatusType.STANDBY
Example #22
0
def run():
    voice = Voice()
    voice.login()

    for feed in settings.FEEDS:
        print(feed.title())
        for message in getattr(voice, feed)().messages:
            print('\t', message)
Example #23
0
 def voice(self):
     has_creds = conf.config.email and conf.config.password
     output_captured = getattr(sys.stdout, 'name') != '<stdout>'
     if not has_creds and output_captured:
         pytest.skip("Cannot run with output captured")
     voice = Voice()
     voice.login()
     return voice
Example #24
0
def send_verification(request, tele):
	voice = Voice()
	voice.login('*****@*****.**', 'hackjamfoodalert')
	recipient = User.objects.get(telephone = tele)
	ver_code = recipient.ver_code
	message = 'Your verification code is %d' % (ver_code)
	voice.send_sms(tele, message)
	print('Message Sent')
Example #25
0
 def getids(self, send="", pas=""):  # take url args send and pas
     voice = Voice()
     voice.login(send, pas)
     ids = []
     inbox = settings.FEEDS[0]
     for message in getattr(voice, inbox)().messages:
         ids.append(message.items()[7][1])
     json.dumps(None)
     return json.dumps(ids)
 def r_gvsms(self, speech, language):
     match = re.match(u"Send text message to (.*\d.*) say (.*\D.*)", speech, re.IGNORECASE)
     phoneNumber = match.group(1)
     text = match.group(2)
     voice = Voice()
     voice.login(gemail, str(gpass))
     voice.send_sms(phoneNumber, text)
     self.say('Your message has been sent!')
     self.complete_request()
Example #27
0
def send_food_notification(request, tele):
	voice = Voice()
	voice.login('*****@*****.**', 'hackjamfoodalert')
	recipient = User.objects.get(telephone=tele)
	favs = Favs.objects.get(user=recipient)
	foods = favs.favorites
	message = 'Your favorite food %s is served at %s' % (foods, "clarkkerr")
	voice.send_sms(tele, message)
	print('Sent')
Example #28
0
def send(number, message):
    user = '******'
    password = '******'
    voice = Voice()
    test = voice.login(user, password)
    print(test)
    number = 9908997698
    message = "hi"
    voice.send_sms(number, message)
Example #29
0
def main():
    global voice
    
    #Google Voice Interface
    voice = Voice()
    voice.login(email,pwd)              #Login
    while True:
        processClass()                   #Process Recieved Messages
        time.sleep(3)
Example #30
0
    def __init__(self, user=None, passwd=None):
        from googlevoice import Voice
        from googlevoice import util

        self.voice = Voice()
        try:
            self.voice.login(user, passwd)
        except util.LoginError:
            raise LoginError
Example #31
0
    def set_credentials(self, email=None, passwd=None):
        """
        set_credentials -- establish the login credentials for Google Voice
        If unspecified, pygooglevoice reverts to looking for ~/.gvoice 
        """
        self.email = email
        self.passwd = passwd

        self.voice = Voice()
        self.already_read_ids = list()
Example #32
0
def main():
    global voice

    #Google Voice Interface
    voice = Voice()
    voice.login(email,pwd)              #Login
    while True:
        voice.sms()                     #Get SMS Data  
        messages = extractSMS(voice.sms.html)      #Get messages
        processMessages(messages)                   #Process Recieved Messages
        time.sleep(30)
Example #33
0
def sms(text):
    '''Connect to Google Voice API and send SMS message'''
    # Connect to Google API
    voice = Voice()
    voice.login(email='', passwd='') # Fill me in with your Google Voice info
    phoneNumber = []   # Fill me in with Phone Number

    # Send the SMS
    for number in phoneNumber:
        voice.send_sms(number, text)
    return
Example #34
0
def send_messages(request):
    if request.method == "POST":
        contacts = Contact.objects.filter(is_active=True)
        EMAIL = os.environ['GV_EMAIL']
        PASSWORD = os.environ['GV_PW']
        voice = Voice()
        voice.login(email=EMAIL, passwd=PASSWORD)
        for contact in contacts:
            contact.send_text(voice)
        messages.success(request, "Sent messages to all active members")
    return HttpResponseRedirect(reverse('before_send_messages'))
Example #35
0
 def call_number(sysTrayIcon, outgoingNumber):
     print 'in call_number', outgoingNumber
     voice = Voice()
     gmail_name = open('/installs/gmail_name', 'r').read()
     print gmail_name
     gmail_password = open('/installs/gmail_password', 'r').read()
     #print gmail_password
     voice.login(gmail_name, gmail_password)
     # todo
     #forwardingNumber = open('/installs/call_here', 'r').read#'8012408783'
     forwardingNumber = '8012408783'
     voice.call(outgoingNumber, forwardingNumber)
Example #36
0
def send_sms(username, password, cellnumber, filenames):
    '''Sends a SMS message to cellnumber via PyGoogleVoice'''

    from googlevoice import Voice

    voice = Voice()
    voice.login(username, password)
    
    text = str()
    for f in filenames:
        text = text + '%s downloaded\n' % f
    voice.send_sms(cellnumber, text)
    return
Example #37
0
    def __init__(self, user, password):
        self.gv = Voice()
        self.gv.login(user, password)

        self.to_phone = None
        self.to_name = None

        self.polltime = 30
        self.step = 0  # fire immediately so that we have data to display

        Chat.__init__(self)

        self.register_event(1, self._update_poll_time)
Example #38
0
def home (request):
	voice = Voice()
	voice.login ()

	phoneNumber = input ('Number to send message to:')
	text = input ('message text:')
	try:

		voice.send_sms (phoneNumber, text)
	except:
		return render_to_response('error.html', {}, context_instance=RequestContext(request))	
	
	return render_to_response('home.html', {}, context_instance=RequestContext(request))
Example #39
0
def login():
    username, password = "******", passwords
    voice = Voice()
    client = voice.login(username, password)
    return client

    #send text to Google Voice number
    def run():
        voice = Voice()
        voice.login()
        phoneNumber = "2062406946"
        text = secret_word
        voice.send_sms(phoneNumber, text)
        print ("Sent "+ secret_word)
Example #40
0
class GoogleVoiceApi():
    def __init__(self):
        self.voice = Voice()
        self.username = os.environ.get("GMAIL_USERNAME")
        self.password = os.environ.get("GMAIL_PASSWORD")
        self.voice.login(self.username, self.password)
        self.to_phone = os.environ.get("BAK_PHONE")

    def get_full_time(self):
        return strftime("%a, %d %b %Y %H:%M:%S", localtime())

    def send_text(self, msg):
        print "Trying to send message to %s at %s" % (self.to_phone,
                                                      self.get_full_time())
        return self.voice.send_sms(self.to_phone, msg)
def test_settings():
    voice = Voice()
    #voice.login()

    #util.pprint(voice.settings)

    assert 1 == 1
Example #42
0
def test_phones():
    voice = Voice()
    #voice.login()

    #util.pprint(voice.phones)

    assert 1 == 1
Example #43
0
def message_me(number, text, **kwargs):
    """ Send me a message using pygooglevoice """
    output = None
    try:
        voice = Voice()
        voice.login(GOOGLE_VOICE_EMAIL, PASSWORD)
        
        if kwargs is not None:
            for key, value in kwargs.iteritems():
                text += " | {}: {}".format(key, value)

        voice.send_sms(number, text)
        output = "Successfully sent text message"

    except Exception, e:
        output = "Error sending message: {}".format(e)
Example #44
0
  def __init__(self, refresh_interval=30):
    """
      * refresh_interval is in seconds
    """
    self.voice = Voice()
    self.voice.login()

    sms = self.voice.sms()
    html = self.voice.sms.html_data
    
    self.conversations = self.getConversations(self.voice) or self.conversations # this in case it fails because of an image or something
    self.last_message_count = self.voice.sms.data['totalSize']
    
    while True:
      self.loop()
      sleep(refresh_interval)
Example #45
0
	def __init__(self, queue):
		self.queue = queue
		
		self.voice = Voice()
		self.voiceLoggedIn = False
		
		self.Authentication = Authentication()
		threading.Thread.__init__ ( self )
Example #46
0
def test_voicemail():
    voice = Voice()
    #voice.login()

    #for message in voice.voicemail().messages:
    #    util.print_(message)

    assert 1 == 1
Example #47
0
class GoogleVoice:
    def __init__(self, user=None, passwd=None):
        from googlevoice import Voice
        from googlevoice import util

        self.voice = Voice()
        try:
            self.voice.login(user, passwd)
        except util.LoginError:
            raise LoginError

    def send(self, number, text):
        """
        Sends a message to a number in any standard format.
        (e.g. 4803335555, (480) 333-5555, etc.)
        """
        self.voice.send_sms(number, text)
Example #48
0
class Poller(object):
   """
   @summary: Polls Google Voice looking for new texts
   """
   
   def __init__(self):
      self.voice = Voice()
      self.voice.login()
      
   def poll(self):
      numbers = []
      inBox = self.voice.sms()
      for msg in inBox.messages:
         if not msg.isRead:
            numbers.append(msg.phoneNumber)
            msg.mark(read=1)
      return numbers
Example #49
0
class GoogleVoice:
    def __init__(self, user=None, passwd=None):
        from googlevoice import Voice
        from googlevoice import util

        self.voice = Voice()
        try:
            self.voice.login(user, passwd)
        except util.LoginError:
            raise LoginError

    def send(self, number, text):
        """
        Sends a message to a number in any standard format.
        (e.g. 4803335555, (480) 333-5555, etc.)
        """
        self.voice.send_sms(number, text)
Example #50
0
 def _SendAlertToPhone(self, phone, msg):
     if not self._sent_one:
         import code
         from googlevoice import Voice
         voice = Voice()
         voice.login(self.monitor_email, self.monitor_pass)
         voice.send_sms(phone, msg)  # Send an SMS.
         voice.call(phone, self.monitor_phone,
                    3)  # Call the person as well.
         self._sent_one = 1
Example #51
0
    def test_login(self, random_gxf):

        responses.add(
            responses.GET, settings.LOGIN, """
                      ...
                      <input type="hidden" name="gxf" value="{random_gxf}">
                      ...
                      """.format(**locals()))

        responses.add(responses.POST, settings.LOGIN_POST)

        responses.add(responses.GET, settings.INBOX,
                      "'_rnr_se': 'special-value'")

        voice = Voice()
        voice.login(email=fake.email(), passwd=fake.password())

        assert voice.special == 'special-value'
Example #52
0
 def __init__(self, usrName, pswd):
     global logger_googleVoice
     self.usrName = usrName
     self.pswd = pswd
     self.voice = Voice()
     self.numReceivedFrom = []
     self.messageReceived = []
     try:
         self.voice.login(self.usrName, self.pswd)
         logger_googleVoice.info("Successfully logged into Google Voice")
     except:
         logger_googleVoice.exception("Unable to login into Google Voice")
         exit(0)
     self.__markAsRead()
     self.__deleteMessages()
     self.__readyNotify()
     self.phoneToSend = ""
     print("Startup complete")
Example #53
0
    def __init__(self, user=None, passwd=None):
        from googlevoice import Voice
        from googlevoice import util

        self.voice = Voice()
        try:
            self.voice.login(user, passwd)
        except util.LoginError:
            raise LoginError
Example #54
0
class GVWrapper:
	voice = None
	logged_in = False

	def __init__( self ):
		self.voice = Voice()

	def login( self, user, passwd ):
		try:
			self.voice.login( user, passwd )
			self.logged_in = True
		except:
			self.logged_in = False


	def SendAlert( self, number, message ):
		if self.logged_in:
			self.voice.send_sms( str(number), message )
def test_delete():
    voice = Voice()
    # voice.login()

    #for message in voice.sms().messages:
    #    if message.isRead:
    #        message.delete()

    assert 1 == 1
Example #56
0
def test_parse_sms():
    voice = Voice()
    #voice.login()

    #voice.sms()
    #for msg in extractsms(voice.sms.html):
    #    print str(msg)

    assert 1 == 1
Example #57
0
def run():
    voice = Voice()
    voice.login()

    outgoingNumber = input('Number to call: ')
    forwardingNumber = input('Number to call from [optional]: ') or None

    voice.call(outgoingNumber, forwardingNumber)

    if input('Calling now... cancel?[y/N] ').lower() == 'y':
        voice.cancel(outgoingNumber, forwardingNumber)
def test_download_mp3():
    download_dir = '.'

    voice = Voice()
    # voice.login()

    #for message in voice.voicemail().messages:
    #    message.download(download_dir)

    assert 1 == 1