I need to integrate disqus on Android app: Below is the script used in webpage, which I want to modify to use in Android:
var disqusData = {
id: userIdHere,
username: userName,
email: userEmail
};
var disqusStr = JSON.stringify(disqusData);
var message = jQuery.base64.encode(disqusStr);
var result = CryptoJS.HmacSHA1(message + " " + 13959635473, "wgEjMAEXMaA8x02fHSHFBFkjsjhdfs");
var hexsig = CryptoJS.enc.Hex.stringify(result);
var hmac = hexsig;
I was able to so partial coding in Android:
JSONObject jsonObj = new JSONObject();
try {
jsonObj.put("id", "47424563");
jsonObj.put("username", "Sweety Bertilla");
jsonObj.put("email", "sweetyber@yahoo.com");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String disqusStr = jsonObj.toString();
String message = Base64.encodeToString(disqusStr.getBytes(), Base64.DEFAULT);
I am not able to construct rest of the script and also I am not sure whatever I have already constructed is correct