Skip to content

Instantly share code, notes, and snippets.

View toru-takahashi's full-sized avatar
🏠
Working from home

Toru Takahashi toru-takahashi

🏠
Working from home
View GitHub Profile
@toru-takahashi
toru-takahashi / actions.yml
Created July 20, 2023 05:34
Yaml example
name: Notify Zendesk Guide Update to Slack
on:
schedule:
- cron: '*/60 * * * *'
jobs:
zendesk_guide_slack_job:
runs-on: ubuntu-latest
name: Zendesk Guide to Slack
//feedback form help center
var articleVotesBtnsBlock = document.querySelector(".article-votes-btns-wrap");
var articleVotesBtns = document.querySelectorAll(".js--article-votes-btn");
var formYes = document.querySelector(".js--form-yes");
var formNo = document.querySelector(".js--form-no");
if(formNo) {
var radioBtns = document.querySelectorAll("input[type='radio'][name='feedback-selection']");
var labvarextareaNo = formNo.querySelector(".article-votes-form-no-textarea-label");
var btnSendYes = document.querySelector(".js--btn-send-yes");
.article-vote-down-explanation {
display: none;
}
.article-votes-form-yes {
display: none;
}
.article-votes-form-yes.visible {
display: block;
<div class="article-votes">
<div class="article-votes-title">Was this article helpful?</div>
<div class="article-votes-btns-wrap">
<span class="article-votes-btn article-votes-btn-yes js--article-votes-btn" data-type="yes">Yes, thanks</span>
<span class="article-votes-btn article-votes-btn-no js--article-votes-btn" data-type="no">Not really</span>
</div>
<form class="article-votes-form-yes js--form-yes">
<textarea class="article-votes-textarea"></textarea>
<label class="article-votes-textarea-label">What did you like about this article? (optional)</label>
<button class="article-votes-button js--btn-send-yes" type="submit">Submit feedback</button>
@toru-takahashi
toru-takahashi / article_page_before.js
Created March 31, 2022 15:07
Add Feedback Field to Zendesk Guide with Slack notification
<div class="article-votes">
<span class="article-votes-question">{{t 'was_this_article_helpful'}}</span>
<div class="article-votes-controls" role='radiogroup'>
{{vote 'up' role='radio' class='button article-vote article-vote-up'}}
{{vote 'down' role='radio' class='button article-vote article-vote-down'}}
</div>
<small class="article-votes-count">
{{vote 'label' class='article-vote-label'}}
</small>
</div>
@toru-takahashi
toru-takahashi / confluence.py
Last active June 2, 2022 20:58
Confluence page info to TD
from atlassian import Confluence
import json
import sys
from fluent import sender
from fluent import event
def get_all_page_ids_from_space(space):
"""
:param space:
@toru-takahashi
toru-takahashi / dump_zendesk_auditlog.py
Created June 6, 2018 01:11
Dump Zendesk Audit Logs
import requests
import pandas as pd
from pandas.io.json import json_normalize
import time
url = 'https://ZENDESKDOMAIN.zendesk.com/api/v2/audit_logs.json?sort_order=desc'
user = 'ZENDESK_EMAIL' + '/token'
pwd = 'ZENDESK_APIKEY'
session = requests.Session()
@@ -112,12 +112,6 @@
self._poll_interval = poll_interval
self._source = source
self._session_props = session_props if session_props is not None else {}
- self._headers = {
- 'X-Presto-Catalog': self._catalog,
- 'X-Presto-Schema': self._schema,
- 'X-Presto-Source': self._source,
- 'X-Presto-User': self._username,
- }
@toru-takahashi
toru-takahashi / article_page.hbs
Last active March 4, 2018 03:42
Articles in Category for Zendesk Guide
<!-- https://github.com/SaneMethod/jquery-ajax-localstorage-cache -->
<script src="{{asset 'jalc.min.js'}}"></script>
<!-- etc... -->
<section class="section-articles collapsible-sidebar">
<h3 class="collapsible-sidebar-title sidenav-title">Articles in this Category</h3>
<div id="siderbar-articles-in-category"></div>
<!-- Original content
<h3 class="collapsible-sidebar-title sidenav-title">{{t 'articles_in_section'}}</h3>
@toru-takahashi
toru-takahashi / example.yml
Created February 10, 2018 04:15
example.yml
in:
type: td
apikey: xxxxx
endpoint: api.treasuredata.com
database: zendesk
query: |
SELECT
id, -- Zendesk UserID
MAP_CONCAT(
MAP(ARRAY[cast('sfdc_company_name' AS VARCHAR)], ARRAY[cast(sfdc_company_name AS VARCHAR)]),