appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

URL Shortening #208

Closed scruffyfox closed 12 years ago

scruffyfox commented 12 years ago

Similar to the way Tw*tter handles url shortening, I prepose using annotations to detect.

The way Tw*tter handles urls is, the base url is shortened (to save character count) with their own t.co link but the original link is still visible in the post.

The way I propose to do this is to have the shortened url in the post text (so it counts the characters properly) but use an annotation to replace the url with the original url, client side.

{
    "type": "net.app.core.url",
    "value": [
        {
            "original_url": "http://mylongurlwhichiwillreplace.com",
            "pos": 20,
            "len": 15
        }       
    ]
}

Where the original post will look like

{
    "text": "Hello, this is my post http://rbn.im/1As3J"
}

Thoughts? Opinions? Suggestions?

Also, how do I set the label on an issue?

mattflaschen commented 12 years ago

@berg said a while back they want to eventually allow arbitrary anchor text. I'm curious whether that is still the plan.

Also, the cross-post annotation addresses some of the use cases. If it's a cross-post, you can appropriately include the full URL in the annotation, and a shortened URL of your choice in the text.

berg commented 12 years ago

Exactly as @mattflaschen said — there won't be core platform support for URL shorteners. We do have plans to allow different link text, but that would likely allow you to set more descriptive anchor text, rather than swap out with a short link.

scruffyfox commented 12 years ago

But if the client uses the post text not the post html, then they will only get the original url. Surely it would be easier to use an annotation to swap out the link on a per-app basis

berg commented 12 years ago

We will not be adding anything to the core product that encourages the use of URL shorteners.

scruffyfox commented 12 years ago

Ok, but im assuming its ok to do it with a different namespace?

tonymillion commented 12 years ago

@scruffyfox you are wrong.

Using entities you can link 'A' (a single char) to a very long URL, essentially making URL shorting irrelevant (and implementing exactly what you propose anyway).

Implement your own scheme if you like, but good luck getting anyone to support it.

berg commented 12 years ago

If you'd like to create an annotation outside the net.app.core namespace for this, OK. We're building the platform to obviate the need for URL shorteners (again, no need to shorten URLs if you can change link text), so it is unlikely Alpha will ever support this annotation.

scruffyfox commented 12 years ago

@tonymillion very valid point but I guess the same could be said about changing the anchor text. @berg thanks for the help! (sometimes urls can get too long for one post, i didnt have enough room to cc you and Mark into my post to Dalton ;)

jmergy commented 12 years ago

It would be great id App.net didn't do anything above and beyond just directly representing whatever the URL is from post passed from the client. Any wacky stuff the client is doing, should stay there.