Skip to content

Instantly share code, notes, and snippets.

[TAGS :iter = path_iterator(tag_tree)]
ID = interaction.id
PATH = :iter._path
VAL = :iter._value
{
"interaction": {
"id": 12345,
"tag_tree": {
"skills": {
"programming": {
"php": 100,
"nodejs": 76,
"java": 50
},
{
"interaction": {
"author": {
"username": "DataSiftDev",
"name": "DataSift Developer",
"id": 155505157,
...
}
},
"links": {
{
"interaction": {
"schema": {
"version": 3
},
"source": "Twitter for iPhone",
"author": {
"username": "example",
"name": "example",
"id": 111111111,
[LINKS :iter = list_iterator(links)]
ID = interaction.id
NAME = interaction.name
USERNAME = interaction.username
TITLE = :iter.title
URL = :iter.url
{
"interaction": {
"user": "datasift",
"id": "12345678901234567890123456789012",
"title": "Example",
"content": "I like Superman, Batman, Incredible Hulk, and Iron Man.",
"tag_tree": {
"creator": [
"Marvel Comics",
"DC Comics"
[INTERACTION_TAGS :iter = tree_iterator(interaction.tag_tree)]
ID = interaction_id
CREATED_AT = interaction.created_at (data_type: datetime, transform: datetime)
TAG_NAME = :iter._path
TAG_VALUE_FLOAT = :iter._value float (condition: is_float)
TAG_VALUE_ARRAY = :iter._value string-array (condition: is_array)
[INTERACTION]
ID = interaction.id
USERNAME = interaction.author.username
IS_RETWEET = twitter.retweeted.id (data_type: integer, transform: exists)
[INTERACTION]
FOLLOWER_RATIO = twitter.user.follower_ratio (data_type: integer)
curl -X POST http://api.datasift.com/v1/preview/create \
-d 'start=1359849600' \
-d 'hash=e25d533cf287ec44fe66e8362f61961f' \
-d 'parameters=interaction.author.link,targetVol,hour;twitter.user.lang,freqDist,10;twitter.user.followers_count,numStats,hour;interaction.content,wordCount,10' \
-d 'sources=twitter,facebook' \
-H 'Authorization: datasift-user:your-datasift-api-key'