API call to list your commands on each computer

  • @davboc asked me for a way to produce a list of his commands. I gave him an API call to use, and he came up with this python script that takes the output and makes it nice and readable. I thought it was pretty cool so I'm sharing it here:

    import subprocess
    string=subprocess.check_output(["curl -k -X POST https://www.triggercmd.com/api/command/commandlist -H 'Authorization: Bearer (your token from Instructions page)'"],stderr=subprocess.STDOUT,shell=True).strip()
    for a in array:
        print a.split('"')[1].strip()

    The output looks like this:

    Downstairs > Calculator
    Downstairs > Delete browse history
    Downstairs > Launch a website
    Downstairs > Notepad
    Downstairs > Rebooting in 10 seconds
    Downstairs > Volume Down
    Downstairs > Volume Up
    Garage > Betsy Garage Door
    Garage > Reboot
    Garage > Russ Garage Door
    Garage > apt update
    Garage > boot russfam
    Laptop > Calculator
    Laptop > Delete browse history in Internet Explorer
    Laptop > Down Arrow
    Laptop > Email my document list
    Laptop > Launch a website
    Laptop > Lock my PC
    Laptop > Play mp3's in your Music folder
    Laptop > Reboot
    Laptop > Update Windows
    MintNAS > Gnome Editor
    MintNAS > Reboot
    MintNAS > apt update
    MintNAS > yum update
    RussFam > Backup Documents
    RussFam > Calculator
    RussFam > Dropbox
    RussFam > Email my document list
    RussFam > Michael Jackson Thriller Album
    RussFam > Mute

Log in to reply