pallupz / covid-vaccine-booking

This tool can be used to automate booking slots on Co-WIN Platform.
MIT License
598 stars 533 forks source link

Setup IFTTT or other automations on your android phone to forward SMS that contain 'CoWIN' to the OTP telegram channel. #184

Open shailesh opened 3 years ago

Vishvajeet590 commented 3 years ago

I added this little piece in generate_otp function wrote a small android app to send data to socket when sms is recieved ( using Broadcast receiver). It sends OTP to function and it keeps running(PC and phone should be on same network ). If want any more info then I can provide it. EDIT : We can also add socket to timeout but i was lazy to add

            soc = socket.socket()
            soc.bind(('',1456))
            soc.listen(5)
            while True:
                c,adrr = soc.accept()
                mes = c.recv(16)
                stringdata = mes.decode('utf-8')
                c.close()
                if stringdata.isdigit and len(stringdata) == 6: 
                    OTP = stringdata
                    break
            soc.close()
            if OTP != None and len(OTP == 6):
                 print("Otp Recieved = "+ stringdata)
            else :
                OTP = input("Enter OTP (If this takes more than 2 minutes, press Enter to retry): ")

`

saurabhsharmaj commented 3 years ago

@Vishvajeet590 could you please share the complete script.. to automate this OTP part.

Vishvajeet590 commented 3 years ago

@Vishvajeet590 could you please share the complete script.. to automate this OTP part.

Hi, bro little late but you can check my Repository about automation. It's an app on which this existing script runs. Otp process is automatic. My repo ---> Here