Underc0de

Programación Scripting => Python => Mensaje iniciado por: BigBear en Agosto 26, 2012, 07:26:51 PM

Título: [PyQT4] Whois Online 0.2
Publicado por: BigBear en Agosto 26, 2012, 07:26:51 PM
Queria hacer mi primer programa en PyQT4 y quise empezar con este simple cliente whois.

Una imagen de como quedo

(http://doddyhackman.webcindario.com/images/whoispy.jpg)

El codigo

Código (python) [Seleccionar]

#!usr/bin/python
#Whois Online 0.2
#Coded By Doddy H

import sys,urllib2,re
from PyQt4 import QtCore,QtGui

nave = urllib2.build_opener()
nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]

def tomar(web,vars) :
return nave.open(web,vars).read()

def whois(domain):
try:
  code = tomar("http://networking.ringofsaturn.com/Tools/whois.php","domain="+domain+"&"+"submit=submit")
  if (re.findall("<PRE>(.*?)<\/PRE>",code,re.S)):
   found = re.findall("<PRE>(.*?)<\/PRE>",code,re.S)
   resul = found[0]
   resul = re.sub("&quot;","",resul)
   resul = re.sub("&gt;&gt;&gt;","",resul)
   resul = re.sub("&lt;&lt;&lt;","",resul)
   return resul
  else:
   return "Not Found"
except:
  print "[-] Page offline\n"

def comando():

new.console.clear()
new.console.appendPlainText(whois(str(new.dom.text())))

app = QtGui.QApplication(sys.argv)

new = QtGui.QWidget()

new.setWindowTitle("Whois Online 0.2 || Coded By Doddy H")
new.resize(450,420)
new.setStyleSheet("QWidget {background-color: #000000;color: #00FF00}")

new.label1 = QtGui.QLabel("Domain : ",new)
new.label1.setStyleSheet("QWidget {background-color: #000000;color: #00FF00;font: normal 17px Verdana}")
new.label1.setGeometry(20,23,80,20)

new.dom = QtGui.QLineEdit(new)
new.dom.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")
new.dom.setGeometry(95,23,200,25)

new.search = QtGui.QPushButton("Search",new)
new.search.setGeometry(310,22,110,28)
new.search.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")

new.label2 = QtGui.QLabel("Console",new)
new.label2.setStyleSheet("QWidget {background-color: #000000;color: #00FF00;font: normal 17px Verdana}")
new.label2.setGeometry(200,70,70,20)

new.console = QtGui.QPlainTextEdit(new)
new.console.setGeometry(50,100,350,300)
new.console.setStyleSheet("QWidget {background-color: #000000; color: #00FF00;border: 2px solid #00FF00}")

new.connect(new.search,QtCore.SIGNAL("clicked()"),comando)

new.show()

sys.exit(app.exec_())

# The End ?
Título: Re:[PyQT4] Whois Online 0.2
Publicado por: panik0 en Agosto 27, 2012, 09:33:59 PM
para que sirv4e
Título: Re:[PyQT4] Whois Online 0.2
Publicado por: [C]orrupted[B]yte en Agosto 27, 2012, 10:04:46 PM
Petardas XD
Título: Re:[PyQT4] Whois Online 0.2
Publicado por: BigBear en Agosto 28, 2012, 01:07:18 PM
es un cliente  whois , sip , debi ponerle supertangas en vez de petardas , pero que desgracia xDD.