This project is no longer actively maintained. Proceed at your own risk!, (*1)
DataSift PHP Client Library
, (*2)
This is the official PHP library for accessing Datasift. See the examples
folder for some simple example usage., (*3)
Getting Started
To get started choose one of our quick start guides:, (*4)
Simple example
This example looks for anything that contains the word "datasift" and simply
prints the content to the screen as they come in., (*5)
createDefinition('interaction.content contains "datasift"');
// Get an HTTP stream consumer for that definition
$consumer = $def->getConsumer(DataSift_StreamConsumer::TYPE_HTTP, new EventHandler());
// Consume it - this will not return unless the stream gets disconnected
$consumer->consume();
?>
See the DataSift documentation for full details of the data contained within
each interaction. See this page on our developer site for an example interaction:
http://dev.datasift.com/docs/targets/interaction/mapping, (*6)
Requirements
- PHP 5 with the cURL extension enabled and openssl for SSL support
- JSON (included in PHP 5.2+, otherwise use http://pecl.php.net/package/json)
The library will use SSL connections by default. While we recommend using SSL
you may disable it if required by passing false as the third parameter when
creating a user, or by calling $user->enableSSL(false) on the user object., (*7)
Testing
To test the library itself, run the tests:, (*8)
composer test
Contributing
Please see CONTRIBUTING for details., (*9)
Credits
License
All code contained in this repository is Copyright 2011-2015 MediaSift Ltd., (*10)
This code is released under the MIT License (MIT). Please see License File for more information., (*11)