Skip to content

Instantly share code, notes, and snippets.

@Miserlou
Created June 22, 2015 05:14
Show Gist options
  • Save Miserlou/3e3e5e5a2c2f5a9344e9 to your computer and use it in GitHub Desktop.
Save Miserlou/3e3e5e5a2c2f5a9344e9 to your computer and use it in GitHub Desktop.
Remove that annoying disclaimer noice from the whois command
#! /usr/bin/env python
from subprocess import Popen, PIPE
import sys
domain = sys.argv[1]
proc = Popen(["whois", domain], stdout=PIPE)
output = proc.communicate()[0]
notice_loc = output.find('NOTICE')
output = output[:notice_loc]
server_info = output.find('for detailed information.')
output = output[server_info+25:]
print output
@KingGame0
Copy link

<style type="text/css"></style> KingGame -- Gold99 PGasia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment