RSS 2.0
Browse posts:
Unanswered |
Mark all read
| Author | Message | ||||||
|---|---|---|---|---|---|---|---|
|
WebMaster9000 Nucleus Disciple Joined: 17 Jan 2005 Posts: 249 Location: Brooklyn, NY |
Simple, can we have a feature that would automatically convert long links in comments to tinyurl, like the way twitter does it. I think it would be much better then the shortening of links that nucleus does. |
||||||
|
|
|||||||
|
Leng Nucleus Guru ![]() Joined: 19 Sep 2004 Posts: 2830 Location: Australia |
If the core already has an automatic way of shortening the links, I wonder if it could be separated out into a plugin? There are a variety of URL shortening services, some of which would have to have APIs, perhaps this plugin could hook into those? _________________
deborahlau.com | To-Do List Questions? See the FAQ, read the docs, or browse our plugins!! |
||||||
|
|
|||||||
|
WebMaster9000 Nucleus Disciple Joined: 17 Jan 2005 Posts: 249 Location: Brooklyn, NY |
[bump] Any hopes of this happening? |
||||||
|
|
|||||||
|
matt_t_hat Nucleus Geek Joined: 21 Aug 2005 Posts: 1124 Location: UK |
The theory for this sort of thing is fairly simple. The core already parses URLs and makes them clickable. So option one is to pass these out in an event for whatever needs to be done to them and option two is to copy said core code and make the call to tinyurl.com or bit.ly or whatever and then update the comment body with the new url text (perhaps on add comment). _________________ Host Plugins | Blog | Hundred Quid A Day | My Big Fat Arse |
||||||
|
|
|||||||
|
WillyP Nucleus Guru ![]() Joined: 30 Aug 2009 Posts: 767 Location: Pembroke, NH |
Perhaps, instead of writing a link text that is of no use to the visitor, write out something like this:
I'm not a coder, is it possible for the the parser to fetch the page title from the target? If so, this way the visitor would at least have a clue where they where going. If not maybe like this:
_________________ My Skins | Suncook Carpentry |
||||||
|
|
|||||||
|
matt_t_hat Nucleus Geek Joined: 21 Aug 2005 Posts: 1124 Location: UK |
I've done that before getting the title can be a case for reg-ex annoyingly: This also works if you are willing or the API provides it for you: <a href="http://tinyurl.com/rndmtxt" title="Planet Descent Banner Dark T Tshirts from Zazzle.com">http://tinyurl.com/rndmtxt</a> I've written an API for making pretty link boxes which might not be what you are looking for You can find it here: http://lordmatt.eu/facelink.php It is not documented but you can just just curl (or whatever) with format=output thus http://lordmatt.eu/facelink.php?url=$URL_ENCODED_URL&format=output and you get the pretty box all ready for you. You can also overwrite the supplied title and description if you want with &t=$URL_ENCODED_TITLE &d=$URL_ENCODED_DESCIPTION As long as you don't hammer the server (caching the output your side is nice) you can help yourself. However the server will defend itself so if the API gets badly abused the abusive IP address ends up in the IPTables block list. _________________ Host Plugins | Blog | Hundred Quid A Day | My Big Fat Arse |
||||||
|
|
|||||||
|
WillyP Nucleus Guru ![]() Joined: 30 Aug 2009 Posts: 767 Location: Pembroke, NH |
Right now the site I had in mind is slow, and I don't mind fixing the occasional html by hand so not a big deal for me. A site where I write, I'll just write html links and no biggie. But I just hate reading somewhere and coming across the typical tiny url link like the example you gave. So I thought I'd put in my two cents worth! _________________ My Skins | Suncook Carpentry |
||||||
|
|
|||||||
|
wgroleau Nucleus Expert Joined: 10 Jun 2006 Posts: 400 Location: Indiana / USA |
If you are going to provide an alternate link, why not do it in the DB? it's pretty trivial—just store the URI in a table with a short hash code which becomes the new URI. More efficient than making a retrieval from some other service. I like all the ideas, though, about different ways of making the link not be such a mystery. I would further suggest that if "full disclosure" is not possible, then provide something similar to preview.tinyurl.com _________________ Wes Groleau |
||||||
|
|
|||||||
|
|
|||||||
|
All times are GMT + 1 Hour
You cannot post new topics in this forum |
|||||||