[twitter-dev] Is there a standard PHP linkify routine?

2011-07-12 Thread Adam Green
Every PHP app that displays tweets needs to apply the entities as
links. Is there a standard function for this available, or are
hundreds of thousands of developers each rolling their own? If you
have a favorite code snippet, please point it out here. Maybe we can
all review them and figure out which is best. I'me specially
interested in solving UTF8 character problems, which cause invalid
link positioning.

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] Is there a standard PHP linkify routine?

2011-07-12 Thread Matthew Terenzio
I've never looked at entities but I turn URLs into links using this:

$linkedtext = ereg_replace([[:alpha:]]+://[^[:space:]]+[[:alnum:]/],a
href=\\\0\\\0/a, $tweet['statustext']);

On Tue, Jul 12, 2011 at 10:30 AM, Adam Green 140...@gmail.com wrote:

 Every PHP app that displays tweets needs to apply the entities as
 links. Is there a standard function for this available, or are
 hundreds of thousands of developers each rolling their own? If you
 have a favorite code snippet, please point it out here. Maybe we can
 all review them and figure out which is best. I'me specially
 interested in solving UTF8 character problems, which cause invalid
 link positioning.

 --
 Twitter developer documentation and resources: https://dev.twitter.com/doc
 API updates via Twitter: https://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 https://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 https://groups.google.com/forum/#!forum/twitter-development-talk


-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk