Package com.rosaloves.bitlyj

Examples of com.rosaloves.bitlyj.Url


      ServletContext servletContext = this.getServletContext();
      JSONObject config = ConfigFetcher.getJsonObjectFromPath(servletContext.getRealPath("/"));
      String bitlyApiKey = config.getString(SettingKeys.BITLY_API_KEY);
      String bitlyUsername = config.getString(SettingKeys.BITLY_USERNAME);
      LOGGER.info("issuing bitly call for url " + longUrlString);
      Url url = as(bitlyUsername, bitlyApiKey).call(shorten(longUrlString));
      LOGGER.info("bitly call done");
      shortUrl = url.getShortUrl();
      LOGGER.info("retrieved short url: " + shortUrl);
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "exception", e);
      throw new FetchException("Unable to create short url", e);
    }
View Full Code Here

TOP

Related Classes of com.rosaloves.bitlyj.Url

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.