Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

New URL Shortener #324

Merged
merged 1 commit into from

2 participants

@guntanis

Targeted to Costa Rica, added it by user's requests.

Thanks-

@cezarsa cezarsa merged commit f66bb71 into cezarsa:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 28, 2011
  1. @guntanis

    Added Mae.cr

    guntanis authored
This page is out of date. Refresh to see the latest.
Showing with 28 additions and 0 deletions.
  1. +28 −0 lib/shortener_lib.js
View
28 lib/shortener_lib.js
@@ -579,6 +579,30 @@ HurlimShortener = {
}
};
+MaecrShortener = {
+ shorten: function(longUrl, useAcct, login, apiKey, serviceUrl, callback) {
+ var url = "http://mae.cr/shorten";
+ var params = {
+ url: longUrl
+ };
+ $.ajax({
+ type: 'GET',
+ url: url,
+ data: params,
+ success: function(data, status) {
+ if(data) {
+ callback(0, data);
+ } else {
+ callback(-1, "Ooops");
+ }
+ },
+ error: function (request, status, error) {
+ callback(-1,'AJAX request failed (bad connection?)');
+ }
+ });
+ }
+};
+
SHORTENERS_BACKEND = {
bitly: {
desc: 'bit.ly',
@@ -653,4 +677,8 @@ SHORTENERS_BACKEND = {
desc: 'hurl.im',
backend: HurlimShortener
}
+ maecr: {
+ desc: 'mae.cr',
+ backend: MaecrShortener
+ }
};
Something went wrong with that request. Please try again.