Advertisement
Blobadoodle

protOS version 1.3 beta 2 dev version

Feb 23rd, 2021
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. print("Loading modules...")
  2. import tweepy
  3. from time import sleep
  4. from os import system
  5. from os import popen
  6. from getpass import getuser
  7. from sys import platform
  8. from datetime import datetime
  9.  
  10. #<-- BOOT/SETUP SEQUENCE START -->
  11. print("Checking compatibility...")
  12.  
  13. if platform == "linux" or platform == "linux2":
  14. os = "linux"
  15. elif platform == "darwin":
  16. os = "osx"
  17. elif platform == "win32":
  18. os = "win"
  19.  
  20. # Variables that contains the credentials to access Twitter API
  21. print("Setting Twitter API Keys..")
  22. ACCESS_TOKEN = 'placeholder'
  23. ACCESS_SECRET = 'placeholder'
  24. CONSUMER_KEY = 'placeholder'
  25. CONSUMER_SECRET = 'placeholder'
  26. version = "1.03b2"
  27. dev = True
  28.  
  29. #Setup access to API
  30. print("Connecting to Twitter api...")
  31. def connect_to_twitter_OAuth():
  32. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  33. auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
  34. api = tweepy.API(auth)
  35. return api
  36. # Create API object
  37. api = connect_to_twitter_OAuth()
  38.  
  39. print("Loading Apps...")
  40.  
  41. apps = {
  42. "h": "help()",
  43. "t": "tweet()",
  44. "e": "shutdown()",
  45. "g": "google()",
  46. "b": "bash()",
  47. "c": "clear()",
  48. "d": "gettime()",
  49. "v": "getver()"
  50. }
  51.  
  52. print("Defining Functions...")
  53. def tweet():
  54. msg = input("Text to tweet: ")
  55. api.update_status(msg)
  56. print("Succesfully sent tweet!")
  57.  
  58. def clear():
  59. if os != "win":
  60. system("clear")
  61. else:
  62. system("cls")
  63.  
  64. def pastebin():
  65. getrun = input("Get or Run? (g/r) ")
  66. if getrun == "r":
  67. paste = input("PasteCode: ")
  68. pastecode = "curl https://pastebin.com/raw/" + paste
  69. stream = popen(pastecode)
  70. exec(stream.read())
  71. print(stream.read())
  72. sleep(1)
  73.  
  74. elif getrun == "g":
  75. print("ERROR: This feature has not yet been implented")
  76.  
  77. def help():
  78. print("Printing list of available commands")
  79. print("h = Show this help menu")
  80. print("t = Tweet a message")
  81. print("e = Exit ProtOS")
  82. print("g = Google")
  83. print("b = Open a Bash prompt")
  84. print("d = Get the current time")
  85. print("p = Allows you to download apps from pastebin")
  86.  
  87. def shutdown():
  88. print("Goodbye!")
  89. sleep(.5)
  90. clear()
  91. while True:
  92. exit()
  93.  
  94. def google():
  95. if os != "win":
  96. googlemsg = input("Google: ")
  97. googlecmd = "tuxi -r " + googlemsg
  98. system(googlecmd)
  99. else:
  100. print("ERROR: This feature is not available on your OS. Please switch to linux.")
  101.  
  102. def gettime():
  103. now = datetime.now()
  104. current_time = now.strftime("%H:%M:%S")
  105. print("Current Time =", current_time)
  106.  
  107. def bash():
  108. bashmsg = input("Bash: ")
  109. system(bashmsg)
  110.  
  111. def getver():
  112. print("Current Version: ", version)
  113. if dev:
  114. print("You are currently Running A developer Version")
  115. stream = popen("curl -s https://pastebin.com/raw/F4H9EyCA")
  116. print("Newest Version: ",stream.read())
  117.  
  118.  
  119. def printLogo():
  120. print("⠀▄▄▄▄▄▄▀▀▀▀▀▀▀▄▄")
  121. print("█⠀⠀⠀⠀⠀⠀▀▄⠀⠀⠀▄▀⠀█▀▀▄▄")
  122. print("⠀█⠀⠀⠀⠀█▀⠀▀▄▀⠀▄▀⠀⠀⠀⠀⠀▀▀▄▄")
  123. print("⠀⠀█⠀⠀⠀⠀▀▄█⠀▄▀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀▀▀▄")
  124. print("⠀⠀⠀█⠀▄▄⠀⠀█⠀█⠀⠀█▀█⠀⠀⠀⠀⠀⠀▀█⠀█")
  125. print("⠀⠀⠀⠀██⠀▀▀▄▄█⠀⠀▀⠀▀⠀⠀⠀⠀⠀⠀⠀⠀⠀█")
  126. print("⠀⠀⠀⠀⠀▀█⠀█⠀⠀⠀█⠀⠀⠀⠀⠀▀▄▄▀▀▄▄█")
  127. print("⠀⠀⠀⠀⠀⠀⠀▀█⠀⠀⠀█▄▄▄▄▄▄▄▄▄▄▄█")
  128. print("⠀⠀⠀⠀⠀⠀⠀⠀ ▀▀▀")
  129.  
  130. def error(prog2):
  131. try:
  132. exec(prog2)
  133. except:
  134. print("Invalid Commnad. Type \"h\" for a list of commands.")
  135.  
  136. def console():
  137. prog = input("ProtOS: ")
  138. if prog in apps:
  139. exec(apps[prog])
  140. else:
  141. error(prog)
  142.  
  143. print("Boot Sequence Complete!")
  144. sleep(.2)
  145. clear()
  146. #<-- BOOT/SETUP SEQUENCE END -->
  147.  
  148. printLogo()
  149. print("Welcome", getuser(),"!")
  150. if os != "linux":
  151. print("WARNING: You're using an unsupported OS and may encounter bugs. For full compatibility please use linux.")
  152. while True:
  153. console()
  154.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement