ehamberg / 9m

9m Unicode URL Shortener
Other
203 stars 15 forks source link

Public API for 9m? #5

Open ghost opened 10 years ago

ghost commented 10 years ago

Is there an API available to shorten URL's?

ehamberg commented 10 years ago

Hi, No there isn't – but there probably should be! If you want to generate URLs, you could POST to /create and read the Location header for now:

$ curl -i --data-urlencode "url=https://en.wikipedia.org/wiki/🍔" http://9m.no/create
HTTP/1.1 302 Found
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 28 May 2014 06:21:01 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: /show/滥㚈

(Note that the /create endpoint is rate-limited with a limit of 10 requests per minute with a burst of 3 requests.)

I'll keep this issue open, though, as it would be nice to have a proper, versioned API.

ehamberg commented 10 years ago

(Huh, github destroyed my unicode character after I posted. The wikipedia link should end with the character 🍔 U+1F354 HAMBURGER.)

Edit: It showed up after a refresh. (Note that Chrome does not support emojis yet for some reason)

ghost commented 10 years ago

Thanks :smile: