8k.no: API


Two URLs are available for other services (for now):
url parameters mandatory
http://8k.no/encode.jsp u : the url
f : the format [json,plain]
tweet : [true,false]
yes
no
no
http://8k.no/decode.jsp c : the code
f : the format [json,plain]
yes
no

For use on your own site:
request/link:
http://8k.no/encode.jsp?u=http://mypage.com/blog&tweet=true

results in a redirect to twitter with the
encoded URL injected into the status text

Encoding examples:

With the format set to JSON:
request:
http://8k.no/encode.jsp?u=http://www.andreasoverland.no/&f=json

response:
eightK({
	"shorturl":"http://8k.no/0",
	"longurl":"http://www.andreasoverland.no",
	"twitterurl":"http://twitter.com/home/?status=http://8k.no/0 ",
});
Omitting the format-parameter, the result defaults to plain text:
request:
http://8k.no/encode.jsp?u=http://www.andreasoverland.no/

response:
http://8k.no/0

Decoding examples:
Without any format parameter:
request:
http://8k.no/decode.jsp?c=0

response:
http://www.andreasoverland.no/
With format parameter set to json:
request:
http://8k.no/decode.jsp?c=0&f=json

response:
eightK({
   "shorturl":"http://8k.no/0",
   "longurl":"http://www.andreasoverland.no",
   "twitterurl":"http://twitter.com/home/?status=http://8k.no/0 ",
});