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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:bfb449ef2b39f66d75879e049a1f0d9796b61e32908ed1c1f3bd00ec7dcf56ee" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
I have a server that uses this director setup: | |
function posts() { | |
var type = 'posts'; | |
analytics(type,this); | |
} | |
function sections() { | |
var type = 'sections'; | |
analytics(type,this); |
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
$ node | |
> var assert = require('assert'); | |
undefined | |
> var i = 10; | |
undefined | |
> var j = 11; | |
undefined | |
> assert.equal(i,j) | |
AssertionError: 10 == 11 | |
at repl:1:9 |
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
» ~/Code/Parsely/web (web+apidocs) [master] | |
$ git checkout -- p2/index.php | |
» ~/Code/Parsely/web (web+apidocs) [master] | |
$ git status | |
# On branch master | |
# Your branch is ahead of 'origin/master' by 1 commit. | |
# (use "git push" to publish your local commits) | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) |
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
parselyCallback815({ | |
data: [ | |
{ | |
tags: null, | |
url: "http://www.factmag.com/2013/11/02/fact-writers-pick-their-top-10-albums-of-all-time/", | |
title: "FACT Writers pick their top 10 albums of all time", | |
section: "Features", | |
author: "joseph", | |
thumb_url_medium: "http://c0001566.cdn1.cloudfiles.rackspacecloud.com/medium_dc0930ae20c72599dab0af096611dbed85bfa2c2.jpg", | |
image_url: "http://factmag-images.s3.amazonaws.com/wp-content/uploads/2013/11/FACT-writers-favourite-albums-of-all-time-11.3.2013-75x50.jpg", |
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
<meta name="parsely-page" content="{"title": "Morrissey hospitalised with concussion after apparent car accident", "link": "http://www.factmag.com/2013/11/04/morrissey-hospitalised-with-concussion-after-apparent-car-accident/", "section": "News", "image_url": "http://factmag-images.s3.amazonaws.com/wp-content/uploads/2013/11/Morrissey041113-75x50.jpg","type": "post","post_id": "189193", "author": "joseph", "pub_date": "2013-11-04T08:43:34Z"}"> |
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 datetime | |
print datetime.strptime('2013-10-29T02:03:59Z','%Y-%m-%dT%H:%M:%S%z' |
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
$ python pings_api.py | |
200 /v2/analytics/posts {"message": "Forbidden", "code": 403, "success": false} | |
200 /v2/analytics/authors {"message": "Forbidden", "code": 403, "success": false} | |
200 /v2/search {"message": "missing api key", "code": 500, "success": false} | |
200 /v2/realtime/posts {"message": "Forbidden", "code": 403, "success": false} | |
200 /v2/analytics/author/Jeff%20Poor/detail {"message": "Forbidden", "code": 403, "success": false} | |
200 /v2/analytics/post/detail {"message": "Forbidden", "code": 403, "success": false} | |
200 /v2/related {"message": "missing api key", "code": 500, "success": false} | |
403 /v2/shares/posts {"message": "Forbidden", "code": 403, "success": false} | |
403 /v2/shares/authors {"message": "Forbidden", "code": 403, "success": 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
// Clears the recommendations div. | |
function clearResults() { | |
var recDiv = $("#recommendations"); | |
recDiv.innerHtml = "<p>Recommendations results to appear here.</p>"; | |
console.log('Reset.'); | |
} |
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
JS: | |
// Callback to populate recommendations div. | |
callback = function(data) { | |
recDiv.html(""); | |
$.each(data.data, function(i, datum) { | |
var thumb = "<div class='thumb'><img src='" + datum.thumb_url_medium + "'></div>", | |
title = "<div class='title'>" + datum.title + "</div>" | |
recDiv.append("<div class='post'>"+title+thumb+"</div>"); | |
}); |