Dnia 05-01-2012 o 14:58:11 Michał Malisz <malis...@gmail.com> napisał(a):

def add_tiny_url(text):
    i = 1
    for m in re.finditer(regulka, text):
        if m.group(0).find("tinyurl") < 100:
            #ekg.printf("generic","tiny__" + str(i) + ": " +
tiny_url(m.group(0)))
            longurl = m.group(0)
            if len(longurl) >= 100:
                    tinyurl = tiny_url(m.group(0))
                    text = text.replace(m.group(0),tinyurl + "\n" +
longurl + "\n")
                    i = i + 1
            return text

A nie dalbys rade poczynic takiej zmiany ktora by pokazywala tytul strony ktorej adres bedzie skrocony? <:
Po czyms takim ta linijke:

text = text.replace(m.group(0),tinyurl + "\n" + longurl + "\n")
Zmienimy na
text = text.replace(m.group(0),tinyurl)
Co daje nam sam link z tinyurl za ktorym moglby sie pojawiac tytul tej skroconej strony ;p


Pozdrawiam!

Odpowiedź listem elektroniczym