* Enqueue each status * * @param string $status */ public function enqueueStatus($status) { /* * In this simple example, we will just display to STDOUT rather than enqueue. * NOTE: You should NOT be processing tweets at this point in a real application, instead they should be being * enqueued and processed asyncronously from the collection process. */ $data = json_decode($status, true); if (is_array($data) && isset($data['user']['screen_name'])) { print $data['user']['screen_name'] . ': ' . urldecode($data['text']) . "\n"; $this->push_data_to_db($data); //$this->AutoTranslate($data); } } } // The OAuth credentials you received when registering your app at Twitter define("TWITTER_CONSUMER_KEY", "your twitter consumer key"); define("TWITTER_CONSUMER_SECRET", "Your twitter consumer secret"); // The OAuth data for the twitter account define("OAUTH_TOKEN", "your twitter application token"); define("OAUTH_SECRET", "your twitter application secret"); // Start streaming $sc = new FilterTrackConsumer(OAUTH_TOKEN, OAUTH_SECRET, Phirehose::METHOD_FILTER); $sc->setLocations(array(array(-0.5103, 51.2868, 0.334, 51.6923))); $sc->setTrack(array('@5liveSport', '@SW_Trains', '@GiveBloodNHS', '@BBCSport', '@bbcweather', '@ukhomeoffice', '@AboutTheBBC', '@EnvAgency', '@NHSEnglandLDN', '@TimeOutLondon', '@CityofLdnOnt', '@BBC', '@GOVUK', '@cityoflondon', '@bbc5live', '@SkyNews', '@BBCBreaking', '@FinancialTimes', '@bbcworldservice', '@BBCWorld', '@BBCNews', '@LondonSHP', '@metpoliceuk', '#LondonTraffic', '@londontraffic', '@TfLTrafficNews', '@LDNTraffic', '@WazeTrafficLON', '@TfLBusAlerts')); $sc->setFollow(array(47331384, 31129844, 22906929, 1155611857, 338237494, 3216970444.0, 400051029)); $sc->consume();
* Enqueue each status * * @param string $status */ public function enqueueStatus($status) { /* * In this simple example, we will just display to STDOUT rather than enqueue. * NOTE: You should NOT be processing tweets at this point in a real application, instead they should be being * enqueued and processed asyncronously from the collection process. */ $data = json_decode($status, true); if (is_array($data) && isset($data['user']['screen_name'])) { print $data['user']['screen_name'] . ': ' . urldecode($data['text']) . "\n"; $this->push_data_to_db($data); // $this->AutoTranslate($data); } } } // The OAuth credentials you received when registering your app at Twitter define("TWITTER_CONSUMER_KEY", "your twitter consumer key"); define("TWITTER_CONSUMER_SECRET", "Your twitter consumer secret"); // The OAuth data for the twitter account define("OAUTH_TOKEN", "your twitter application token"); define("OAUTH_SECRET", "your twitter application secret"); // Start streaming $sc = new FilterTrackConsumer(OAUTH_TOKEN, OAUTH_SECRET, Phirehose::METHOD_FILTER); $sc->setLocations(array(array(10.18, 56.142, 10.234, 56.1721))); $sc->setTrack(array('@StiftenAGF', '@jpaarhus', '#Aarhus', '@AarhusKultur', '@smagaarhus', '@AarhusNyheder', '@AarhusPortaldk', '@Aarhus2017', '@OpenDataAarhus', '@aarhusupdate', '@AskVest', '@SundhedOgOmsorg', '@ArhusVejr', '@aarhus_ints', '@AGFFANdk', '@AarhusCykelby', '@VisitAarhus', '@larshaahr')); $sc->setFollow(array(3601200017.0, 3370065087.0, 3330970365.0, 2911388001.0, 2706568231.0, 2647614595.0, 2201213730.0, 1324132976, 1065597596, 210987829, 159110346, 112585923, 77749562, 38227253, 36040150)); $sc->consume();