phirehose | PHP interface to Twitter Streaming API | REST library
kandi X-RAY | phirehose Summary
kandi X-RAY | phirehose Summary
PHP interface to Twitter Streaming API
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Connect to the stream
- Read data from stream
- Prepare parameters for request
- Process a queue file
- Generate signature
- Get the stream for the status
- Process all queue files .
- Rotate the active stream file
- Enqueue a status message .
- Check the filter predicate
phirehose Key Features
phirehose Examples and Code Snippets
Community Discussions
Trending Discussions on phirehose
QUESTION
I am trying to connect to streaming API of twitter and retrieve tweets keywords using specific keywords. I am using the phirehose library for the same. It says in the twitter documentation that "commas as logical ORs, while spaces are equivalent to logical ANDs (e.g. ‘the twitter’ is the AND twitter, and ‘the,twitter’ is the OR twitter)."
But I want to search for keywords with AND operator even if there are other words in between. Meaning if we want to search for tweets having Keyword1 AND Keyword2, tweets which have only one keyword should not be retrieved.
Using the settrack function of the phirehose library -
...ANSWER
Answered 2017-Nov-22 at 10:36140dev by Adam Green gives a solution for this by using ``typeenum('words','phrase') NOT NULL DEFAULT 'words'
Please see - http://140dev.com/twitter-api-programming-blog/streaming-api-enhancements-part-2-keyword-collection-database-changes/ and
QUESTION
I am working with Twitter REST API [PHP] for a month. Now I try STREAMING API because REST API has several downsides.
I use fennb/phirehose to work with Streaming API.
But after several trial and error, I realise that I can't got past/previous tweets using Streaming API.
- I run the script
- I post tweet
console/cmd will catch my tweet immediately
I stop the script
- I post tweet
- I run the script
- console not return any result.
The problem is, in programming and server, sometimes shit happen. Let's call it server down or lost internet connection. I will never get all previous tweet which posted when my server down. (I have 40 search term and more later).
So. i wanna ask:
- Can we get previous tweet using Streaming API?
- How to prevent/solve this case (console throw error, server restart, internet down, etc)?
ANSWER
Answered 2017-Feb-26 at 19:56Twitter's basic streaming API is realtime and about 1% of the actual firehouse of Tweets. You cannot retrieve older Tweets via the stream, and would need to fallback to the basic REST API to check for anything missed in the event of disconnection.
Twitter's enterprise data APIs include historical PowerTrack which can let you get older Tweets, as well as a replay capability in the event of disconnection, but these APIs are commercial.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install phirehose
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page