coffeebeforecode

gcm-Web-Whatsapp.py

Oct 9th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.06 KB | None | 0 0
  1. import subprocess
  2. import sys
  3.  
  4. def install(package):
  5.     subprocess.check_call([sys.executable, "-m", "pip", "install", package])
  6.  
  7. install("pyautogui")
  8. install("pandas")
  9.  
  10. import pyautogui as pg
  11. import webbrowser as web
  12. import time
  13. import pandas as pd
  14. import math
  15.  
  16. message = '''Greetings from Sigma Xi,%0a
  17. %0a
  18. Thank you for registering for Sigma Xi’s Git Commit Merge. We are delighted to have you.%0a
  19. %0a
  20. Our speaker, Devansh Sehgal will guide you through the basics of GitHub which is a web-based version-control and collaboration platform for software developers. He will walk you through the A - Z of GitHub and also show how to host static websites through GitHub pages. %0a
  21. %0a
  22. Devansh will also guide you through open source contribution for the HacktoberFest.%0a
  23. %0a
  24. We look forward to your participation in the event. Please find the event details below:%0a
  25. %0a
  26. Date: 10th October 2021%0a
  27. Timing: 3:00 PM to 5:00 PM%0a
  28. Platform: MS Teams%0a
  29. Meeting Link: https://bit.ly/SigmaGitCommitMerge%0a
  30. %0a
  31. You can join the event through the given link. %0a
  32. %0a
  33. You can also join the discord server for any doubts :  https://discord.gg/DkcSP5xH %0a
  34. %0a
  35. For any queries, contact:%0a
  36. %0a
  37. Amit Priyadarshi%0a
  38. %2B91 77356 29090%0a
  39. %0a
  40. Krish Jain%0a
  41. %2B91 9962153121%0a
  42. %0a
  43. Find us on:%0a
  44. %0a
  45. LinkedIn: %0a
  46. www.linkedin.com/company/sigma-xi-vit/mycompany/%0a
  47. %0a
  48. Instagram: %0a
  49. www.instagram.com/sigmaxi.vit/%0a
  50. %0a
  51. Facebook: %0a
  52. www.facebook.com/SigmaXiVIT/%0a
  53. %0a
  54. Regards %0a
  55. Team Sigma Xi VIT
  56. '''
  57.  
  58. workbook = pd.read_excel('gcmVTOP.xlsx')
  59.  
  60. data_dict = workbook.to_dict('list')
  61. numbers = data_dict['Number']
  62. first = True
  63. for num in numbers:
  64.     if (math.isnan(num)):
  65.         continue
  66.     print("Sending message to", int(num))
  67.     time.sleep(4)
  68.     web.open("https://web.whatsapp.com/send?phone="+f"91{int(num)}+"+"&text="+message)
  69.     if first:
  70.         time.sleep(12)
  71.         first=False
  72.     width,height = pg.size()
  73.     time.sleep(8)
  74.     pg.click(width/2,height/2)
  75.     pg.press('enter')
  76.     time.sleep(8)
  77.     pg.hotkey('ctrl', 'w')
Add Comment
Please, Sign In to add comment