KGIII / pino-twitter

Automatically exported from code.google.com/p/pino-twitter
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Yourls (URL Sherter) #248

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is the draft code to add Yourls.org to URL Shorter.

To work, user need this vars, and pino need to can ask for them:
apikey = "abcde1234";
yourls_api = "http://mydomain/yourls-api.php";

/* shorten with Yourls */
private string shorter_isgd(string url) throws RestError {
    var map = new HashTable<string, string>(str_hash, str_equal);
    map.insert("format", 'simple');
    map.insert("action", 'shorturl');
    map.insert("signature", apikey);
    map.insert("url", url);

    string req_url = yourls_api;
    return api.make_request(req_url, "GET", map);
}

Original issue reported on code.google.com by gazambuja on 7 May 2010 at 4:57