This file contains 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() { | |
var client = ZAFClient.init(); | |
client.invoke('resize', { width: '100%', height: '400px' }); | |
showStart(); | |
$("#get-tasks").click(function() { | |
getTaskData(client); | |
}); | |
}); | |
function showStart() { |
This file contains 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 json | |
import requests | |
from bottle import route, template, run, static_file, request, response | |
@route('/create_ticket', method=['GET', 'POST']) | |
def handle_form(): | |
if 'verified_email' in request.cookies: | |
ask_email = False |
This file contains 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 dateutil.parser | |
import pandas as pd | |
topic = pd.read_pickle('my_serialized_data') | |
posts_df = pd.DataFrame(topic['posts'], columns=['id', 'title', 'created_at', 'author_id']) | |
users_df = pd.DataFrame(topic['users'], columns=['id', 'name']).drop_duplicates(subset=['id']) | |
posts_df['created_at'] = posts_df['created_at'].apply(lambda x: dateutil.parser.parse(x).date()) |
This file contains 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 urllib.parse import urlencode | |
import requests | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
session = requests.Session() | |
session.auth = credentials | |
params = { | |
'query': 'type:ticket status:open', |
This file contains 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 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 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 datetime | |
import csv | |
import requests | |
credentials = 'your_zendesk_email', 'your_zendesk_password' | |
zendesk = 'https://your_subdomain.zendesk.com' | |
language = 'some_locale' |
This file contains 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
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use JSON; | |
use MIME::Base64; | |
use URI::Escape; | |
my $credentials = encode_base64('your_email_address:your_password'); | |
my %params = ( |
This file contains 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 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) |
NewerOlder