Skip to content

Instantly share code, notes, and snippets.

View DeskWOW's full-sized avatar

Desk.com Customer WOW Team DeskWOW

View GitHub Profile
// Sign hash with secret
var hash = CryptoJS.HmacSHA256(context, shared);
// encrypt signed hash to base64
var b64Hash = CryptoJS.enc.Base64.stringify(hash);
// split request at '.'
var hashedContext = signed_req.split('.')[0];
var context = signed_req.split('.')[1];
app.post('/', function (req, res) {
// Desk secret key
var shared = "YOUR SHARED KEY";
})
app.post('/', function (req, res) {
})
{
"name": "my_canvas_app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"body-parser": "^1.15.0",
"crypto-js": "^3.1.6",
"express": "^4.13.4"
},
var express = require('express'),
bodyParser = require('body-parser'),
app = express(),
path = require('path'),
CryptoJS = require("crypto-js");
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'bower_components')));
app.use(bodyParser.json()); // create application/json parser
function run(){
var items = $(".ticket_filter_item_non_selectable");
if (items.length == 0){
console.log("ALL DONE!");
return;
}
var item = items[0];
item.click();
setTimeout(function(){
var link = $("a:contains('Undelete Case')");
├── index.js
└── public
└── views
└── index.html
<html>
<head>
<title>My Canvas App</title>
<!-- stylesheet -->
<link rel="stylesheet" type="text/css" href="https://necolas.github.io/normalize.css/3.0.2/normalize.css">
</head>
<body>
<h3>Please select the product related to this case</h3>
<form>
<div>
@DeskWOW
DeskWOW / reply_theme.html
Last active August 29, 2015 14:27
One reply theme, multiple agent signatures
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" style="color:#333; font-family:Arial; font-size:14px; line-height:150%; text-align:left;">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>