Advertisement
lolsalat

[AD] Unicorn

Dec 18th, 2020 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. import requests
  2.  
  3. class UnicornExtension(Extension):
  4. """Unicorn shell"""
  5.  
  6. def __init__(self):
  7. super().__init__("unicorn")
  8. self.text = requests.get("https://asciiman.neocities.org/MLP.html").text.split("Mattia")[1:]
  9.  
  10.  
  11. def unicorn_command(self, args=""):
  12. """find out yourself :)"""
  13. import random
  14. cur = self.text[random.randrange(len(self.text))]
  15. print(cur.replace("|\n|", "\n"))
  16. try:
  17. script = """
  18. (function (srcs,cfg) { var cbcount = 1; var callback = function () { -- cbcount; if (cbcount === 0) { BrowserPonies.setBaseUrl(cfg.baseurl); if (!BrowserPoniesBaseConfig.loaded) { BrowserPonies.loadConfig(BrowserPoniesBaseConfig); BrowserPoniesBaseConfig.loaded = true; } BrowserPonies.loadConfig(cfg); if (!BrowserPonies.running()) BrowserPonies.start(); } }; if (typeof(BrowserPoniesConfig) === "undefined") { window.BrowserPoniesConfig = {}; } if (typeof(BrowserPoniesBaseConfig) === "undefined") { ++ cbcount; BrowserPoniesConfig.onbasecfg = callback; } if (typeof(BrowserPonies) === "undefined") { ++ cbcount; BrowserPoniesConfig.oninit = callback; } var node = (document.body || document.documentElement || document.getElementsByTagName('head')[0]); for (var id in srcs) { if (document.getElementById(id)) continue; if (node) { var s = document.createElement('script'); s.type = 'text/javascript'; s.id = id; s.src = srcs[id]; node.appendChild(s); } else { document.write('\u003cscript type="text/javscript" src="'+ srcs[id]+'" id="'+id+'"\u003e\u003c/script\u003e'); } } callback();})({"browser-ponies-script":"https://panzi.github.io/Browser-Ponies/browserponies.js","browser-ponies-config":"https://panzi.github.io/Browser-Ponies/basecfg.js"},{"baseurl":"https://panzi.github.io/Browser-Ponies/","fadeDuration":500,"volume":1,"fps":25,"speed":3,"audioEnabled":false,"showFps":false,"showLoadProgress":true,"speakProbability":0.1,"spawn":{},"spawnRandom":9});void(0)
  19. """
  20. get_ipython().run_cell_magic('javascript', '', script)
  21. except:
  22. pass
  23.  
  24. ext = UnicornExtension()
  25. debugger.extensions[ext.name] = ext
  26. ext.enable(debugger)
  27. debugger.log("[unicorn]: Extension loaded successfully!")
  28. debugger.log("[unicorn]: Credits for unicorns: Mattia Basaglia (http://mattbas.org/)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement