This file contains hidden or 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 TABLE IF NOT EXISTS `datasiftStreamExample` ( | |
`incID` INT NOT NULL AUTO_INCREMENT , | |
`id` VARCHAR(32) NULL , | |
`content` VARCHAR(1000) NULL , | |
`source` VARCHAR(30) NULL , | |
`username` VARCHAR(45) NULL , | |
`name` VARCHAR(50) NULL , | |
`type` VARCHAR(45) NULL , | |
`link` VARCHAR(150) NULL , | |
`created_at` VARCHAR(45) NULL , |
This file contains hidden or 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
{ | |
"stream": [ | |
{ | |
"interaction": { | |
"source": "twitterfeed", | |
"author": { | |
"username": "GBDataStream", | |
"name": "Gary Bender", | |
"id": 194297785, | |
"avatar": "http://a2.twimg.com/sticky/default_profile_images/default_profile_3_normal.png", |
This file contains hidden or 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
HTTP/1.1 200 OK | |
Connection: keep-alive | |
Content-Type: application/json; charset=utf-8 | |
Transfer-Encoding: chunked | |
1 | |
821 | |
{ "interaction": { | |
"source": "foursquare", |
This file contains hidden or 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
GET /8bc638ddff76a9c01bd6a454de03bd30 HTTP/1.1 | |
Host: stream.datasift.com | |
Authorization: <username>:<api_key> | |
Connection: Keep-Alive |
This file contains hidden or 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
{ | |
"dpu": 0.2, | |
"detail": { | |
"contains": { | |
"count": 2, | |
"dpu": 0.2, | |
"targets": { | |
"interaction.content": { | |
"count": 1, | |
"dpu": 0.1 |
This file contains hidden or 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
<?php | |
require '../lib/datasift.php'; | |
require '../config.php'; | |
date_default_timezone_set('Europe/London'); | |
$user = new DataSift_User(USERNAME, API_KEY); | |
$def = $user->createDefinition(twitter.text contains "coffee" AND | |
twitter.place.country exists'); | |
try { |
This file contains hidden or 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": { | |
"source": "web", | |
"author": { | |
"username": "ishabellaw", | |
"name": "IZΔBELLΔ☺ ", | |
"id": 159438737, | |
"avatar": "http://a0.twimg.com/profile_images/1610359102/10_normal.jpg", | |
"link": "http://twitter.com/ishabellaw" | |
}, |
This file contains hidden or 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": { | |
"source": "Flipboard", | |
"author": { | |
"username": "nik", | |
"name": "Nick Halstead", | |
"id": 3364401, | |
"avatar": "http://a3.twimg.com/profile_images/1681240315/nick2png_normal.png", | |
"link": "http://twitter.com/nik" | |
}, |
This file contains hidden or 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": { | |
"source": "TweetDeck", | |
"author": { | |
"username": "stewarttownsend", | |
"name": "Stewart Townsend", | |
"id": 14065694, | |
"avatar": "http://a2.twimg.com/profile_images/1302306721/twitterpic_normal.jpg", | |
"link": "http://twitter.com/stewarttownsend" | |
}, |
This file contains hidden or 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
Abu Dhabi | |
Adelaide | |
Alaska | |
Almaty | |
Amsterdam | |
Arizona | |
Astana | |
Athens | |
Atlantic Time (Canada) | |
Auckland |