TencentMicroblogSender.class.getName()});
try {
final JSONObject article =
data.getJSONObject(Article.ARTICLE);
final QWeiboSyncApi api = new QWeiboSyncApi();
final String appKey = preference.getString(
Preference.TENCENT_MICROBLOG_APP_KEY);
final String appSecret = preference.getString(
Preference.TENCENT_MICROBLOG_APP_SECRET);
final String tokenKey = preference.getString(
Preference.TENCENT_MICROBLOG_TOKEN_KEY);
final String tokenSecret = preference.getString(
Preference.TENCENT_MICROBLOG_TOKEN_SECRET);
final String articleTitle = article.getString(Article.ARTICLE_TITLE);
final String blogTitle = preference.getString(Preference.BLOG_TITLE);
final String blogHost = preference.getString(Preference.BLOG_HOST);
final String articlePermalink =
"http://" + blogHost + article.getString(
Article.ARTICLE_PERMALINK);
final StringBuilder contentBuilder = new StringBuilder(articleTitle);
contentBuilder.append(" - ").append(blogTitle).append(" ").append(
articlePermalink);
api.publishMsg(appKey, appSecret, tokenKey, tokenSecret,
contentBuilder.toString(),
null, ResultType.ResultType_Json);
} catch (final Exception e) {
LOGGER.log(Level.SEVERE,
"Sends article to Tencent microblog error: {0}",