This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container-divider"></div> | |
<div class="container"> | |
<nav class="sub-nav"> | |
{{breadcrumbs}} | |
{{search submit=false}} | |
</nav> | |
<div class="category-container"> | |
<div class="category-content"> | |
<header class="page-header"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from bs4 import BeautifulSoup | |
import requests | |
""" | |
1. Place the HTML files in a folder named 'html_files' in the same folder as this file. | |
2. Change the settings starting on line 14 to values that are valid for your account. | |
3. In your command line interface, navigate to the folder containing this file and run `python3 post_articles.py`. | |
4. In Guide, set the correct sections, authors, and access permissions for the articles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
zendesk = 'https://your_subdomain.zendesk.com' | |
def post_profile(profile): | |
data = {'profile': profile} | |
url = f'{zendesk}/api/sunshine/profile' | |
headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} | |
response = requests.post(url, json=data, auth=credentials, headers=headers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
zendesk = 'https://your_subdomain.zendesk.com' | |
def track_event(payload): | |
url = f'{zendesk}/api/sunshine/events' | |
headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} | |
response = requests.post(url, json=payload, auth=credentials, headers=headers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() { | |
// reset page | |
document.getElementById('error-msg').style.display = "none"; | |
document.getElementById('details').style.display = "none"; | |
var url = window.location.href; | |
if (url.indexOf('your_redirect_url') !== -1) { | |
if (url.indexOf('access_token=') !== -1) { | |
var access_token = readUrlParam(url, 'access_token'); | |
localStorage.setItem('zauth', access_token); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
zendesk = 'https://your_subdomain.zendesk.com' | |
language = 'some_locale' | |
section_id = 123456 | |
# Configure the list section articles endpoint | |
endpoint = zendesk + '/api/v2/help_center/{}/sections/{}/articles.json'.format(language, section_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="main.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="content"></div> | |
<script id="start-hdbs" type="text/x-handlebars-template"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
from bs4 import BeautifulSoup | |
# Settings | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
zendesk = 'https://your_instance.zendesk.com' | |
backup_folder = '20xx-xx-xx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() { | |
var client = ZAFClient.init(); | |
switch (action) { | |
case 'notifySuccess': | |
client.invoke('notify', 'Request successful!'); | |
break; | |
case 'notifyFailure': | |
client.invoke('notify', msg, 'error'); | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, run, template, request, response, static_file | |
import requests | |
@route('/sidebar') | |
def send_iframe_html(): | |
qs = request.query_string | |
response.set_cookie('my_app_params', qs) | |
return template('start', qs=qs) |
NewerOlder