Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
OCTOWISDOM

OCTOWISDOM v4.0

Make :octocat: say random stuff on your UNIX box today! My program uses Python 2.7 style code to request GitHub zen, and then pipe it into Octocatsays. None of this code would be possible without the :octocat:GitHub API:octocat:! Anyways, that's about it for my program. It's pretty much just a POC/advertisement for the GitHub API. You should check it out! 😄 I have instructions on how to make it in Chapter 2 of my GitBook.

Changelog:

  • Made quotes standard ', along with the tutorial.
  • Added reference to GitBook.
  • Python 3 implementation made available courtesy of 2to3!
  • Spaces are now converted to %20.
  • Now says full quote!
Disclaimer: I have no affiliation whatsoever with GitHub or the Python Software Foundation. I'm not compensated to do this, (except with an AWESOME code hosting service and language standard! 😆)
import commands;
print(commands.getoutput('curl -s https://api.github.com/octocat?s='+commands.getoutput('curl -s https://api.github.com/zen').replace(' ','%20')));
quit();
import subprocess;
print((subprocess.getoutput('curl -s https://api.github.com/octocat?s='+subprocess.getoutput('curl -s https://api.github.com/zen').replace(' ','%20'))));
quit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment