Skip to content

Instantly share code, notes, and snippets.

View chucknado's full-sized avatar

Charles Nadeau chucknado

View GitHub Profile
@chucknado
chucknado / oauth_app_start.py
Last active August 29, 2015 14:13
A Bottle app starter file for the Zendesk OAuth tutorial at https://support.zendesk.com/hc/en-us/articles/204210446
from bottle import route, template, redirect, static_file, error, request, response, run
@route('/home')
def show_home():
return template('home')
@route('/')
def handle_root_url():
@chucknado
chucknado / oauth_app_finish.py
Last active August 29, 2015 14:13
A Bottle app file for the Zendesk OAuth tutorial at https://support.zendesk.com/hc/en-us/articles/204210446
from urllib.parse import urlencode
import json
import requests
from bottle import route, template, redirect, static_file, error, request, response, run
@route('/home')
def show_home():
return template('home')
<bodydiv outputclass="training_videos_embedded">
<xref href="//fast.wistia.net/embed/iframe/{video_id}?popover=true" format="html" scope="external" outputclass="wistia-popover[height=630,playerColor=3ea9f5,width=1120]">
<image href="https://embed-ssl.wistia.com/deliveries/{image_id}?image_play_button=true&amp;image_play_button_color=333333e0&amp;image_crop_resized=260x146"/>
</xref>
<bodydiv outputclass="training_videos_caption">
{video_title} ({duration})
</bodydiv>
</bodydiv>
<bodydiv outputclass="training_videos_embedded">
<xref href="//fast.wistia.net/embed/iframe/drpvo1p0yi?popover=true" format="html" scope="external" outputclass="wistia-popover[height=630,playerColor=3ea9f5,width=1120]">
<image href="https://embed-ssl.wistia.com/deliveries/48154ba03b89b764078wb7b21cd1890e70c716ae.jpg?image_play_button=true&amp;image_play_button_color=333333e0&amp;image_crop_resized=260x146"/>
</xref>
<bodydiv outputclass="training_videos_caption">
Creating a Personal View (01:11)
</bodydiv>
</bodydiv>
(function() {
return {
requests: {
taskPost: function(new_task_data) {
return {
url: 'https://app.asana.com/api/1.0/tasks',
headers: {"Authorization": "Basic " + btoa('{api_key}' + ":")},
type: 'POST',
@chucknado
chucknado / auth.py
Last active January 20, 2017 18:43
A Bottle application for a Zendesk App tutorial called "Add OAuth" at https://support.zendesk.com/hc/en-us/articles/205225558
import os
from urllib.parse import urlencode
import requests
from bottle import route, redirect, request, response, template, run
@route('/auth/asana')
def asana_auth():
params = {
@chucknado
chucknado / main.js
Last active January 20, 2017 21:32
A Zendesk app for a tutorial on adding OAuth at https://support.zendesk.com/hc/en-us/articles/205225558
$(function() {
var client = ZAFClient.init();
client.invoke('resize', {width: '100%', height: '400px'});
showStart();
$("#check-token").click(function (event) {
event.preventDefault();
client.invoke('notify', 'Authenticating...');
@chucknado
chucknado / make_backup.pl
Last active February 22, 2016 21:41
A Perl script for the REST API tutorial, "Backing up your knowledge base with Perl", at https://support.zendesk.com/hc/en-us/articles/204395003
use strict;
use warnings;
use MIME::Base64;
use LWP::UserAgent;
use JSON;
use Time::Piece;
use File::Spec::Functions;
use File::Path 'make_path';
my $credentials = encode_base64('your_email_address:your_password');
@chucknado
chucknado / make_backup.py
Last active December 9, 2019 11:32
A Python script for the REST API tutorial, "Backing up your knowledge base," at https://help.zendesk.com/hc/en-us/articles/229136947
import os
import datetime
import csv
import requests
credentials = 'your_zendesk_email', 'your_zendesk_password'
zendesk = 'https://your_subdomain.zendesk.com'
language = 'some_locale'
@chucknado
chucknado / publish_package.py
Last active January 6, 2017 22:44
A Python script for the REST API tutorial, "Automating your first localization handoff (Help Center)," at https://support.zendesk.com/hc/en-us/articles/203691406
import os
import glob
import json
import requests
from bs4 import BeautifulSoup, Comment
def main():
subdomain = 'your_subdomain' # setting
email = 'your_email' # setting