Skip to content

Instantly share code, notes, and snippets.

View richcaudle's full-sized avatar

Rich Caudle richcaudle

View GitHub Profile
@richcaudle
richcaudle / product-launch-views.sql
Created January 22, 2014 12:38
Additional views required for product launch blog example.
CREATE VIEW tagged_source AS
SELECT i.interaction_id, t.label AS tag
from interaction i
inner join tag_labels t on t.interaction_id = i.interaction_id
where t.namespace = 'sources.category';
CREATE VIEW tagged_provider AS
SELECT i.interaction_id, t.label AS tag
from interaction i
inner join tag_labels t on t.interaction_id = i.interaction_id
@richcaudle
richcaudle / json-sample-product-launch.json
Created January 22, 2014 12:32
Sample JSON snippet for product launch blog post
"tag_tree": {
"sources": {
"category": ["manual"]
},
"professions": {
"function": ["creative"]
},
"news": {
"provider": ["ABC News"]
}
@richcaudle
richcaudle / introducing-scoring-1.json
Last active December 31, 2015 03:58
Introducing Scoring Snippet 1
{
"interaction": {
"content": " http://videos.com/funny-cat",
"source": "Twitter for Android"
},
"twitter": {
"user": {
"created_at": "Wed, 31 Jul 2012 13:01:22 +0000",
"statuses_count": 23,
"friends_count": 132,
@richcaudle
richcaudle / introducing-scoring-2.json
Last active December 31, 2015 03:49
Introducing Scoring Snippet 2
{
"interaction": {
"content": "http://videos.com/funny-cat",
"source": "Twitter for Android",
"tag_tree": {
"quality": {
"suspected_bot": 10
}
},
"twitter": {
@richcaudle
richcaudle / using-tag-namespaces-1.json
Created December 12, 2013 15:38
Using Tag Namespaces
{
"interaction": {
"content": "$NKE Raises Quarterly Dividend 14%",
"source": "Twitter for iPhone",
"tag_tree": {
"dowjones": {
"company": ["Nike"]
},
"device": ["Apple"]
}
@richcaudle
richcaudle / applyingtags-2.json
Last active December 31, 2015 03:19
Applying Tags Snippet 2
{
"interaction": {
"content": "Check out my holiday pics, Venice was beautiful!",
"source": "Twitter for iPhone",
"tags": ["iPhone","iOS"]
}
}
{
"interaction": {
@richcaudle
richcaudle / applyingtags-1.json
Last active December 30, 2015 03:59
Applying Tags Snippet 1
{
"interaction": {
"content": "Check out my holiday pics, Venice was beautiful!",
"source": "Twitter for iPhone"
}
}
{
"interaction": {
"link": "http://www.italia.it/en/discover-italy/veneto/venice.html"
@richcaudle
richcaudle / gist:6817722
Created October 3, 2013 21:53
My first GIST
require 'yaml'
parameters={
"likes": false,
"posts_by_others": true,
"comments": true,
"page_likes": false,
"like_counts": true
}
# flatten before URL-encoding
# Include the DataSift library
import datasift
# Create a client
client = datasift.Client('DATASIFT_USERNAME', 'DATASIFT_API_KEY')
# Declare a filter in CSDL, looking for content mentioning music
csdl = 'interaction.content contains "music"'
# Compile the filter