Last active
August 29, 2015 14:09
-
-
Save lapointexavier/81db1c69bb7119634fd1 to your computer and use it in GitHub Desktop.
Vessel challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import urllib2 | |
import base64 | |
def decode(data): | |
try: | |
return base64.decodestring(data) | |
except: | |
return data | |
if __name__ == '__main__': | |
decoded = None | |
rx = 'decode64\(\"(.*)\"\)' | |
fp = urllib2.urlopen('http://www.vessel.com/careers/apply.rb') | |
encoded = re.split(rx, fp.read()); | |
while (len(encoded) > 1): | |
decoded = decode(''.join(encoded[1].split(r'\n'))) | |
encoded = re.split(rx, decoded); | |
print('# ' + re.split('#(.*)\n', decoded)[3]) | |
if decoded: | |
print('\n Finally, ain\'t gonna run Ruby: \n\n ' + decoded) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment