Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Loading modules...")
- import tweepy
- from time import sleep
- from os import system
- from os import popen
- from getpass import getuser
- from sys import platform
- from datetime import datetime
- #<-- BOOT/SETUP SEQUENCE START -->
- print("Checking compatibility...")
- if platform == "linux" or platform == "linux2":
- os = "linux"
- elif platform == "darwin":
- os = "osx"
- elif platform == "win32":
- os = "win"
- # Variables that contains the credentials to access Twitter API
- print("Setting Twitter API Keys..")
- ACCESS_TOKEN = 'placeholder'
- ACCESS_SECRET = 'placeholder'
- CONSUMER_KEY = 'placeholder'
- CONSUMER_SECRET = 'placeholder'
- version = "1.03b2"
- dev = True
- #Setup access to API
- print("Connecting to Twitter api...")
- def connect_to_twitter_OAuth():
- auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
- auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
- api = tweepy.API(auth)
- return api
- # Create API object
- api = connect_to_twitter_OAuth()
- print("Loading Apps...")
- apps = {
- "h": "help()",
- "t": "tweet()",
- "e": "shutdown()",
- "g": "google()",
- "b": "bash()",
- "c": "clear()",
- "d": "gettime()",
- "v": "getver()"
- }
- print("Defining Functions...")
- def tweet():
- msg = input("Text to tweet: ")
- api.update_status(msg)
- print("Succesfully sent tweet!")
- def clear():
- if os != "win":
- system("clear")
- else:
- system("cls")
- def pastebin():
- getrun = input("Get or Run? (g/r) ")
- if getrun == "r":
- paste = input("PasteCode: ")
- pastecode = "curl https://pastebin.com/raw/" + paste
- stream = popen(pastecode)
- exec(stream.read())
- print(stream.read())
- sleep(1)
- elif getrun == "g":
- print("ERROR: This feature has not yet been implented")
- def help():
- print("Printing list of available commands")
- print("h = Show this help menu")
- print("t = Tweet a message")
- print("e = Exit ProtOS")
- print("g = Google")
- print("b = Open a Bash prompt")
- print("d = Get the current time")
- print("p = Allows you to download apps from pastebin")
- def shutdown():
- print("Goodbye!")
- sleep(.5)
- clear()
- while True:
- exit()
- def google():
- if os != "win":
- googlemsg = input("Google: ")
- googlecmd = "tuxi -r " + googlemsg
- system(googlecmd)
- else:
- print("ERROR: This feature is not available on your OS. Please switch to linux.")
- def gettime():
- now = datetime.now()
- current_time = now.strftime("%H:%M:%S")
- print("Current Time =", current_time)
- def bash():
- bashmsg = input("Bash: ")
- system(bashmsg)
- def getver():
- print("Current Version: ", version)
- if dev:
- print("You are currently Running A developer Version")
- stream = popen("curl -s https://pastebin.com/raw/F4H9EyCA")
- print("Newest Version: ",stream.read())
- def printLogo():
- print("⠀▄▄▄▄▄▄▀▀▀▀▀▀▀▄▄")
- print("█⠀⠀⠀⠀⠀⠀▀▄⠀⠀⠀▄▀⠀█▀▀▄▄")
- print("⠀█⠀⠀⠀⠀█▀⠀▀▄▀⠀▄▀⠀⠀⠀⠀⠀▀▀▄▄")
- print("⠀⠀█⠀⠀⠀⠀▀▄█⠀▄▀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀▀▀▄")
- print("⠀⠀⠀█⠀▄▄⠀⠀█⠀█⠀⠀█▀█⠀⠀⠀⠀⠀⠀▀█⠀█")
- print("⠀⠀⠀⠀██⠀▀▀▄▄█⠀⠀▀⠀▀⠀⠀⠀⠀⠀⠀⠀⠀⠀█")
- print("⠀⠀⠀⠀⠀▀█⠀█⠀⠀⠀█⠀⠀⠀⠀⠀▀▄▄▀▀▄▄█")
- print("⠀⠀⠀⠀⠀⠀⠀▀█⠀⠀⠀█▄▄▄▄▄▄▄▄▄▄▄█")
- print("⠀⠀⠀⠀⠀⠀⠀⠀ ▀▀▀")
- def error(prog2):
- try:
- exec(prog2)
- except:
- print("Invalid Commnad. Type \"h\" for a list of commands.")
- def console():
- prog = input("ProtOS: ")
- if prog in apps:
- exec(apps[prog])
- else:
- error(prog)
- print("Boot Sequence Complete!")
- sleep(.2)
- clear()
- #<-- BOOT/SETUP SEQUENCE END -->
- printLogo()
- print("Welcome", getuser(),"!")
- if os != "linux":
- print("WARNING: You're using an unsupported OS and may encounter bugs. For full compatibility please use linux.")
- while True:
- console()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement