Skip to content

Instantly share code, notes, and snippets.

View caseysoftware's full-sized avatar

Danger Casey caseysoftware

View GitHub Profile
@caseysoftware
caseysoftware / classification.json
Created December 16, 2015 02:41
A sample classification payload
{
"_class": "ClassificationInsight",
"bundle_id": "abcde12345",
"created": "2015-09-17T18:48:48.058Z",
"id": "edcba56789",
"name": "classification",
"status": "ready",
"updated": "2015-09-17T18:48:48.061Z",
"_links": {
"clarify:bundle": {
@caseysoftware
caseysoftware / classification.sh
Created December 16, 2015 02:39
Makes a request to get the classification
curl https://api.clarify.io/v1/bundles/abcde12345/insights/edcba56789 \
--header "Authorization: Bearer myapikey" | jq '.'
# The jq portion is optional and just used to pretty print the resulting json
@caseysoftware
caseysoftware / insights.sh
Created December 16, 2015 02:37
A list of sample insights available for a bundle
{
"bundle_id": "abcde12345",
"created": "2015-03-04T05:03:04.292Z",
"updated": "2015-05-16T20:39:37.508Z",
"_class": "Insights",
"_links": {
"curies": [
{
"href": "/docs/insights/{rel}",
"name": "insight",
@caseysoftware
caseysoftware / get-insights.sh
Last active December 16, 2015 02:51
Make a request to get all the insights for a bundle
curl https://api.clarify.io/v1/bundles/abcde12345/insights \
--header "Authorization: Bearer myapikey" | jq '.'
# The jq portion is optional and just used to pretty print the resulting json
@caseysoftware
caseysoftware / load.sh
Last active December 16, 2015 02:48
Using curl to load a French media file
curl --data "media_url=http://media.clarify.io.s3.amazonaws.com/video/speeches/je-vous-ai-compris-1958-06-04.mp4" \
--data "name=Je Vous ai Compris" 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 / test.php
Last active December 28, 2016 11:31
This is a simple script to get all of your likes from Facebook via their API for my blog post: Social APIs for Social Evil - http://caseysoftware.com/blog/social-apis-for-social-evil
<?php
// This includes the PHP library
require_once __DIR__ . '/vendor/autoload.php';
/*
* This file has a total of three values:
* - The App ID and App Secret received when you create a new Application.
* - The person/application-specific Access Token, normally granted via the OAuth process.
*
* For simplicity here, I've skipped the OAuth process and retrieved my Access Token via the
TEDGlobal 2013: How reliable is your memory?
249.27 -- 250.53
260.03 -- 260.91
624.42 -- 625.46
638.04 -- 638.93
666.35 -- 667.08
674.88 -- 675.74
684.98 -- 685.76
699.54 -- 700.48
855.2 -- 855.94
@caseysoftware
caseysoftware / search.py
Last active August 29, 2015 14:18
This is used to help students find the most important parts of their class lectures. The full description is here: http://clarify.io/blog/a-study-hint-for-final-exams/
from clarify_python import clarify
clarify.set_key('my api key')
result = clarify.search(query='"on the exam"')
results = result['item_results']
items = result['_links']['items']
index = 0
for item in items:
@caseysoftware
caseysoftware / loading.py
Last active August 29, 2015 14:18
This is used to help students load their class lectures into Clarify. The full description is here: http://clarify.io/blog/a-study-hint-for-final-exams/
from clarify_python import clarify
clarify.set_key('my api key')
clarify.create_bundle(name='TEDGlobal 2013: How reliable is your memory?', media_url='http://media.clarify.io/video/presentations/ElizabethLoftus_TEDxGlobal2013-480p.mp4')
@caseysoftware
caseysoftware / setup.sh
Last active August 29, 2015 14:18
How to install the Clarify Python module using pip. Check out our Quickstarts for more information: http://clarify.io/docs/quickstarts/
$ pip install clarify_python