Skip to content

Class for sending/receiving messages on Google Hangouts

Notifications You must be signed in to change notification settings

adrish96/hangouts_client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hangouts_client

Class for sending/receiving messages on Google Hangouts (auth via OAUTH).

Before Use
  1. Go to Google APIs and generate secret client ID/password.
  2. Fill in values in config.ini
Usage

e.g. Setup Hangouts bot instance, connect and send message:

config_file = '/path/to/config.ini'
hangouts = HangoutsClient(config_file)
if hangouts.connect():
    hangouts.process(block=False)
else:
    print('Failed to connect to Hangouts!')
time.sleep(5)  # give time for roster to be fetched
# Sends to all Hangouts contacts found online: 
hangouts.send_to_all('Hope you enjoyed my stories.')
# Send to Hangouts user specified by full name:
hangouts.send_to(['Itiot Anton', ], 'Hey when is your wedding?')
# Send to Hangouts user specified by :
hangouts.send_to(['ahf9v8qah4wfnasd@public.talk.google.com', ], 'Wake up')
hangouts.disconnect(wait=True)

Outdated gif:

About

Class for sending/receiving messages on Google Hangouts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%