i’m building a simple site where users can post comments about “things”.
What I want to do is in some way “analyze” the comment they post to detect Links (and provide tags) images (maybe display previews), videos, etc.
I’m building the site with django. I think there must be some kind of library to do that server side, and must be some plugin for JQuery.
What do you recommend? Do you know something that can help me with that? Is it better to do it client side or server side?
Thanks a lot!
EDIT:
I’ll use an example. Suppose a user post this comment:
“Hello guys, i love this new site: example.com”
That should be translated to:
"Hello guys, i love this new site: <a href='http://example.com'>example.com</a>"
Plase note that i don’t want to use a WYSIWYG editor!
Depending on how flexible you want to make this, you’re might have to write up some regular expressions. If you don’t know what they are or how to use them, they allow you to search for patterns in strings and manipulate them. For more information, take a look here:
http://www.regular-expressions.info/tutorial.html
If you decided to do this on the client side, in a similar way to how Stack Overflow does things, you could use something like this:
Which comes out as
(Note that that won’t grab every possible URL, just a few common ones)