Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra comments on example streaming.php #43

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/streaming.php
Expand Up @@ -23,6 +23,7 @@
*/

function my_streaming_callback($data, $length, $metrics) {
//$data can be empty when twitter sends a keep alive.
echo $data .PHP_EOL;
return file_exists(dirname(__FILE__) . '/STOP');
}
Expand All @@ -42,7 +43,15 @@ function my_streaming_callback($data, $length, $metrics) {
// the bounding box -122.41,37.77,-122.40,37.78 OR are by themattharris

$params = array(
'track' => 'twitter',
//matches tweets containing 'twitter' 'Twitter' '#Twitter'
'track' => 'twitter',
//matches tweets containing 'twitter' or 'love' (no spaces!)
//'track' => 'twitter,love'
//matches tweets containing 'twitter' and 'love'
//'track' =>'twitter love'
//Warning on extra spaces - below matches 'twitter' but not 'love'!
//'track' =>'twitter, love'

// Around Twitter HQ. First param is the SW corner of the bounding box
'locations' => '-122.41,37.77,-122.40,37.78',
'follow' => '777925' // themattharris
Expand Down