This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
285 additions
and
138 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
php: | ||
- 5.6 | ||
- 5.5 | ||
- 5.4 | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
|
||
matrix: | ||
allow_failures: | ||
- php: 7.0 | ||
- php: hhvm | ||
|
||
script: phpunit tests/ |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* This simple example demonstrates how to use the Pylon Sample API endpoint | ||
* | ||
* @category DataSift | ||
* @package PHP-client | ||
* @author Ryan Stanley <ryan.stanley@datasift.com> | ||
* @copyright 2015 MediaSift Ltd. | ||
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) | ||
* @link http://www.mediasift.com | ||
*/ | ||
|
||
// Include the DataSift library | ||
require dirname(__FILE__) . '/../../lib/datasift.php'; | ||
|
||
// Include the configuration - put your username and API key in this file | ||
require dirname(__FILE__) . '/../../config.php'; | ||
|
||
// Authenticate | ||
echo "Creating user...\n"; | ||
$user = new DataSift_User(USERNAME, API_KEY, false); | ||
|
||
$filter = '(fb.content any "coffee" OR fb.hashtags in "tea") AND fb.language in "en"'; | ||
|
||
//Validate the CSDL | ||
$validate = DataSift_Pylon::validate($user, $filter); | ||
|
||
echo "Definition has been successfully validated, DPUs: {$validate['dpu']} created at: {$validate['created_at']} \n\n"; | ||
|
||
//Create the PYLON object and manually enter a Pylon Hash to use in the sample; you'll need to | ||
// replace the hash below with a real PYLON hash from your own DataSift account | ||
$pylon = new DataSift_Pylon($user, array('hash' => '1a4268c9b924d2c48ed1946d6a7e6288')); | ||
|
||
// Setting up parameters for the /pylon/sample request | ||
$start = 1445209200; | ||
$end = 1445274000; | ||
$count = 10; | ||
|
||
$sample = $pylon->sample($filter, $start, $end, $count); | ||
|
||
echo "Sample created successfully"; |
Oops, something went wrong.