Skip to content

Loading…

Extra comments on example streaming.php #43

Closed
wants to merge 1 commit into from

2 participants

@artumi-richard

Hi

I had a few problems using the streaming.php as a basis. The new comments would have made life a little easier for me. I hope you agree.

@themattharris

hey artumi-richard, i've moved the examples to their own repository here: https://github.com/themattharris/tmhOAuth-examples but remember your helpful comments.

i've added your comments into that repository with props in the commit message.
thanks!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 10 additions and 1 deletion.
  1. +10 −1 examples/streaming.php
View
11 examples/streaming.php
@@ -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');
}
@@ -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
Something went wrong with that request. Please try again.