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
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 |
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
"tag_tree": { | |
"sources": { | |
"category": ["manual"] | |
}, | |
"professions": { | |
"function": ["creative"] | |
}, | |
"news": { | |
"provider": ["ABC News"] | |
} |
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
{ | |
"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, |
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
{ | |
"interaction": { | |
"content": "http://videos.com/funny-cat", | |
"source": "Twitter for Android", | |
"tag_tree": { | |
"quality": { | |
"suspected_bot": 10 | |
} | |
}, | |
"twitter": { |
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
{ | |
"interaction": { | |
"content": "$NKE Raises Quarterly Dividend 14%", | |
"source": "Twitter for iPhone", | |
"tag_tree": { | |
"dowjones": { | |
"company": ["Nike"] | |
}, | |
"device": ["Apple"] | |
} |
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
require 'yaml' |
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
parameters={ | |
"likes": false, | |
"posts_by_others": true, | |
"comments": true, | |
"page_likes": false, | |
"like_counts": true | |
} | |
# flatten before URL-encoding |
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
# 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 |
NewerOlder