Created
April 29, 2013 22:17
-
-
Save daryo918/5485256 to your computer and use it in GitHub Desktop.
post nuevos
This file contains 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
#!/usr/env/python | |
import Tkinter,urllib2,re,os,subprocess | |
from Tkinter import * | |
class program: | |
def __init__(self,master): | |
frame=Frame(master) | |
frame.grid() | |
Label(master, text="Titulo" , foreground="Red").grid(row=0) | |
Label(master, text="creado por", foreground="Red").grid(row=0, column=1) | |
Label(master, text="Enlace", foreground="Red").grid(row=0, column=2) | |
self.pagina() | |
rou=1 | |
rou2=1 | |
rou3=1 | |
for post in self.posts: | |
Label(master, text=post).grid(row=rou, column=0) | |
rou+=1 | |
for creador in self.posteador: | |
Label(master, text=creador).grid(row=rou2, column=1) | |
rou2+=1 | |
for enlace in self.enlaces: | |
func="self.abrir"+str(rou3) | |
self.boton=Button(master, text="abrir", command=lambda enla=enlace: os.system("start "+ enla)).grid(row=rou3,column=2) | |
rou3+=1 | |
def pagina(self): | |
try: | |
# page=urllib2.urlopen("http://foro.rootnets.net/") | |
page=urllib2.urlopen("http://www.portalhacker.net") | |
except: | |
print "la pagina se encuentra fuera de servicio" | |
nuevos=page.read() | |
self.posts=re.findall("\<dt\>\<strong\>\<a href=\".+\" rel=\"nofollow\"\>(.+)\</a\>\</strong\>",nuevos) | |
self.enlaces=re.findall("\<dt\>\<strong\>\<a href=\"(.+)\" rel=\"nofollow\"\>.+\</a\>\</strong\>",nuevos) | |
self.posteador=re.findall("</strong\> por \<a href=\".+\"\>(.+)\</a\> \(\<a href=",nuevos) | |
def abrir1(self): | |
print "hola" | |
root=Tk() | |
root.title("Foro ROOTNETS By daryo") | |
app=program(root) | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment