Skip to content

Instantly share code, notes, and snippets.

View caseysoftware's full-sized avatar

Danger Casey caseysoftware

View GitHub Profile
@caseysoftware
caseysoftware / video.html
Last active January 2, 2016 07:05
This is a sample snippet of how to embed captions within the video.js player. This is used in the closed captioning post.
<video id="clarify_video" class="video-js vjs-default-skin"
controls preload="auto" width="640" height="264"
data-setup='{"example_option":true}'>
<source src="http://example.com/clarify-video.mp4" type='video/mp4' />
<source src="http://example.com/clarify-video.webm" type='video/webm' />
<source src="http://example.com/clarify-video.ogv" type='video/ogg' />
<track kind="captions" src="http://example.com/path/to/captions.vtt" srclang="en" label="English" default>
</video>
@caseysoftware
caseysoftware / head.html
Last active January 2, 2016 07:06
These are the javascript files to include to use video.js. This is used in the closed captioning post.
<link href="http://vjs.zencdn.net/5.0/video-js.min.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/5.0/video.min.js"></script>
@caseysoftware
caseysoftware / get-captions.sh
Last active January 2, 2016 07:06
This is how to request an insight (in this case, captions). This is used in the closed captioning post.
curl https://api.clarify.io/v1/bundles/abcde12345/insights/fadbe23456 \
--header "Authorization: Bearer myapikey"
@caseysoftware
caseysoftware / order-captions.sh
Last active January 2, 2016 07:06
This is how to order closed captioning for a given bundle. This is used in the closed captioning post.
curl --data "insight=captions_r9" https://api.clarify.io/v1/bundles/abcde12345/insights \
--header "Authorization: Bearer myapikey"
@caseysoftware
caseysoftware / load.sh
Last active January 2, 2016 07:07
This is how to load a file into Clarify.io. This is used in the closed captioning post.
curl --data "media_url=http://media.clarify.io/video/presentations/SirKenRobinson-TED2006-How-Schools-Kill-Creativity.mp4" \
--data "name=Sir Ken Robinson – TED 2006" https://api.clarify.io/v1/bundles \
--X POST --header "Authorization: Bearer myapikey"
@caseysoftware
caseysoftware / keywords.json
Created December 16, 2015 02:55
Sample JSON payload for keywords
{
"bundle_id": "abcde12345",
"created": "2015-05-16T20:39:37.507Z",
"id": "54321edcba",
"name": "spoken_keywords",
"status": "ready",
"track_data": [
{
"keywords": [
{
@caseysoftware
caseysoftware / keywords.sh
Last active December 16, 2015 02:54
Makes a request to get the keywords
curl https://api.clarify.io/v1/bundles/abcde12345/insights/54321edcba \
--header "Authorization: Bearer myapikey" | jq '.'
# The jq portion is optional and just used to pretty print the resulting json
@caseysoftware
caseysoftware / bundle_callback.json
Created December 16, 2015 02:49
The resulting callback from creating a bundle
{
"id":"abcde12345",
"_class":"Ref",
"_links":{
"self":{
"href":"/v1/bundles/abcde12345"
},
"curies":[
{
"href":"/docs/rels/{rel}",
@caseysoftware
caseysoftware / load.sh
Created December 16, 2015 02:48
Using curl to load a media file
curl --data "media_url=http://media.clarify.io/audio/books/dorothyandthewizardinoz_01_baum_64kb.mp3" \
--data "notify_url=http://example.org/sample-receiver" \
--data "name=Dorothy and the Wizard of Oz" https://api.clarify.io/v1/bundles \
--X POST --header "Authorization: Bearer myapikey" | jq '.'
# The jq portion is optional and just used to pretty print the resulting json
@caseysoftware
caseysoftware / multi-lang.sh
Created December 16, 2015 02:44
Sample code to perform a language-based search
curl https://api.clarify.io/v1/search?query=compris \
--data "language=fr" \
--header "Authorization: Bearer myapikey"