home.html {{from gluon.contrib.autolinks import expand_one}} {{def find_url(text):}} {{s = text.find("http")}} {{e = text.find(" ", s)}} {{if s is not -1:}} {{if e!=-1:}} {{url = text[s:e+1]}} {{else:}} {{url = text[s:]}} {{return url}} {{pass}} {{return None}} {{pass}}
#I know the indentation isn't necessary in view but it helps me keep my sanity {{url=find_url(message.message)}} {{=XML(expand_one(url,cache.ram('mycache',lambda:dict(),3600))) if url is not None else ''}} if the message contains a url (i already posted example urls), the xml(expand_one(url)) line just converts the url to an anchor link. i don't see the youtube video render, neither do the google viewer thingy show up for the files. am i missing something? cos i'm sure i've done this like a hundred times and it's a bit weird. now i feel like i'm a bit lost. On Thursday, July 16, 2015 at 11:50:19 AM UTC, Massimo Di Pierro wrote: > > Are you sure your code has not changed? We have not changed the logic > there in a year or more. > > On Thursday, 16 July 2015 04:44:34 UTC-5, Samuel Sowah wrote: >> >> https://www.youtube.com/watch?v=Itlc9NUOx_Y >> http://www.sec.gov/news/speech/2012/spch020912co.pdf >> www.sigmobile.org/mobicom/2011/slides/25-understanding-slides.pptx >> >> On Thursday, July 16, 2015 at 7:41:00 AM UTC, Massimo Di Pierro wrote: >>> >>> Perhaps they no longer support oembed? Can you provide an example of a >>> URL? >>> >>> On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote: >>>> >>>> currently, when I use autolinks' expand_one, I don't get youtube videos >>>> rendering anymore, or anything for that matter, not even files. it just >>>> turns the urls into anchor links. something I'm missing? >>>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.