elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [PyQT4] URL Shorter 0.2
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [PyQT4] URL Shorter 0.2  (Leído 1,546 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[PyQT4] URL Shorter 0.2
« en: 27 Agosto 2012, 17:29 pm »

Explotando mi limitado tiempo al pedo decidi aprovecharme nuevamente de la API de la pagina tinyurl.com para hacer una nueva version de este simple script.

Una imagen de como quedo



El codigo

Código
  1. #!usr/bin/python
  2. #URL Shorter 0.2
  3. #Coded By Doddy H
  4.  
  5. import sys,urllib2,re
  6. from PyQt4 import QtCore,QtGui
  7.  
  8. def toma(web) :
  9. nave = urllib2.Request(web)
  10. 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');
  11. op = urllib2.build_opener()
  12. return op.open(nave).read()
  13.  
  14. def cortar():
  15. new.resul.setText(toma("http://tinyurl.com/api-create.php?url="+str(new.url.text())))
  16.  
  17. app = QtGui.QApplication(sys.argv)
  18.  
  19. new = QtGui.QWidget()
  20.  
  21. new.setWindowTitle("URL Shorter 0.2 || Coded By Doddy H")
  22. new.resize(350,150)
  23. new.setStyleSheet("QWidget {background-color: #000000;color: #FFFF00}")
  24.  
  25. new.label1 = QtGui.QLabel("URL : ",new)
  26. new.label1.setStyleSheet("QWidget {background-color: #000000;color: #FFFF00;font: normal 17px Verdana}")
  27. new.label1.setGeometry(20,23,80,20)
  28.  
  29. new.url = QtGui.QLineEdit(new)
  30. new.url.setStyleSheet("QWidget {background-color: #000000; color: #FFFF00;border: 2px solid #FFFF00}")
  31. new.url.setGeometry(75,23,247,25)
  32.  
  33. new.label2 = QtGui.QLabel("Result : ",new)
  34. new.label2.setStyleSheet("QWidget {background-color: #000000;color: #FFFF00;font: normal 17px Verdana}")
  35. new.label2.setGeometry(20,60,80,20)
  36.  
  37. new.resul = QtGui.QLineEdit(new)
  38. new.resul.setStyleSheet("QWidget {background-color: #000000; color: #FFFF00;border: 2px solid #FFFF00}")
  39. new.resul.setGeometry(95,60,230,25)
  40.  
  41. new.search = QtGui.QPushButton("Short",new)
  42. new.search.setGeometry(90,110,170,28)
  43. new.search.setStyleSheet("QWidget {background-color: #000000; color: #FFFF00;border: 2px solid #FFFF00}")
  44.  
  45. new.connect(new.search,QtCore.SIGNAL("clicked()"),cortar)
  46.  
  47. new.show()
  48.  
  49. sys.exit(app.exec_())
  50.  
  51. # The End ?
  52.  


« Última modificación: 27 Agosto 2012, 17:31 pm por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Ruby] URL Shorter 0.1
Scripting
BigBear 0 1,389 Último mensaje 6 Febrero 2012, 19:42 pm
por BigBear
[Python] URL Shorter 0.1
Scripting
BigBear 4 2,385 Último mensaje 8 Febrero 2012, 15:05 pm
por BigBear
[Perl] URL Shorter 0.1
Scripting
BigBear 0 1,333 Último mensaje 6 Febrero 2012, 19:43 pm
por BigBear
[PyQT4] LocateIP 0.1
Scripting
BigBear 4 3,119 Último mensaje 29 Agosto 2012, 01:48 am
por -- KiLiaN --
[Java] URL Shorter 0.1
Java
BigBear 0 1,147 Último mensaje 12 Enero 2013, 03:11 am
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines