Já aconteceu, ao clicar em um link para fazer download abriu uma nova página com uma propaganda enorme para cadastrar o seu celular e o link invertido?
Exemplo: http://www.sitenormal.com/?url=moc.oditrevnietis.www//:ptth
Aconteceu isto comigo!!! A página verdadeira estava com o endereço invertido. E para facilitar minha vida e brincar um pouco com Python e PyQT4 fiz um pequeno hack utility para organizar o texto invertido.
Download: reversetext.py
É necessário instalar:
Segue script abaixo:
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################################# # reverse_util.py - Graphical Reverse Text Utility # # Using Library: # - PyQt4 # - Python 2.5 # # by Razec, https://razec.wordpress.com ######################################June/2010################################################ import sys from PyQt4 import QtGui from PyQt4 import QtCore class HelloWindow(QtGui.QMainWindow): def __init__(self, win_parent = None): #Init the base class QtGui.QMainWindow.__init__(self, win_parent) self.create_widgets() def create_widgets(self): #Widgets self.label = QtGui.QLabel("Inversed Text:") self.invtext_edit = QtGui.QLineEdit() self.rev_button = QtGui.QPushButton("Revert") #connect signal QtCore.QObject.connect(self.rev_button , QtCore.SIGNAL("clicked()") , self.on_hello_clicked) #Vertical layout v_box = QtGui.QVBoxLayout() v_box.addWidget(self.label) v_box.addWidget(self.invtext_edit) v_box.addWidget(self.rev_button) #Create central widget, add layout and set central_widget = QtGui.QWidget() central_widget.setLayout(v_box) self.setCentralWidget(central_widget) def on_hello_clicked(self): QtGui.QMessageBox.information(self , "Reversed Text!" , "Reversed -->: %s" % self.invtext_edit.text()[::-1] , QtGui.QMessageBox.Ok) if __name__ == "__main__": # Create the QApplication app = QtGui.QApplication(sys.argv) #The Main window main_window = HelloWindow() main_window.show() # Enter the main loop app.exec_()
O segredo do python para inverter qualquer texto é este:
"Reversed -->: %s" % self.invtext_edit.text()[::-1]
Traduzindo…
texto[::-1]
E como q instala esse arquivo reversetext.py?
Luiz você não instala este script, mas para ele funcionar você precisa instalar o Python e o PyQt4, e executa-lo.
O Ederson Melo escreveu um artigo ensinando como instalar o Python: Conhecendo e Instalando Python
Abraço
gente tem um site que eh muito facil fazer isso, eh o
http://www.inverterlink.tk
muito bom, nao tem publicidade e o visual eh super limpo; vale a pena conferir! bjs
Joana obrigado pela excelente dica. =)
Esse aki eu mesmo desenvolvi em delphi
Muito fácil
http://www.amplainformatica.com.br/anuncios/InversorPro.rar
pode usar que é free
Alex muito show seu programa, bem prático gostei da idéia de abrir o browser também.
Só faltou disponibilizar o código para quem desejar alterar.
Abraço