Tuesday, August 18, 2009 at 7:52 PM.
godsTweetSuite.getLinkFromTweet
on getLinkFromTweet (s) { <<Changes <<4/27/09; 11:54:05 AM by DW <<If the text contains a link return it, otherwise return the empty string. local (ix = string.patternmatch ("http://", string.lower (s)), linktext = ""); if ix > 0 { local (i, ch); for i = ix to sizeof (s) { ch = s [i]; if ch == ' ' { break}; linktext = linktext + ch}}; return (linktext)}; bundle { //test code local (s = "Oh the buzzing http://scripting.com/ of the bees."); s = "http://scripting.com/ Oh the buzzing http://scripting.com/ of the bees."; dialog.alert ('"' + getLinkFromTweet (s) + '"')}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.