Comments (6)
Yes, I haven't been able to support these message types yet... Thinking to add an option to receive messages in addition to standard tweet payloads, as existing I/F just sends tweets.
like,
pid = spawn(fn ->
stream = ExTwitter.stream_filter(track: "twitter", receive_messages: true)
for message <- stream do
case message do
tweet = %ExTwitter.Tweet{} ->
IO.puts tweet.text
warning = %ExTwitter.Streaming.StallWarning{} ->
IO.puts warning.code
end
end
end)
or something.
from extwitter.
I've pushed experimental implementation for several message, but haven't been able to test all of the message. In the case you know good way to test (reproduce message), please let me know.
from extwitter.
Which messages have you not been able to reproduce? I can look into trying to help generate them.
from extwitter.
Thanks. I think I couldn't reproduce stall warning, though I tried with slowing down stream read (through sleeping). At the moment, I implemented / tested based on the example in the twitter page in the above.
from extwitter.
Did you send stall_warnings: true
parameter to Twitter endpoint when initiating the stream? Looks like perhaps they only send them in that case (and only once "about every 5 minutes" which means they may not be consistent..).
(That said, the mocked test for this looks good to me!)
from extwitter.
Thanks for the information. I wasn't aware about the 5 minutes part, so retried with the following and left for a while. But seems not receiving (though not sure if this sleep is reasonable).
stream = ExTwitter.stream_filter(track: "twitter", stall_warnings: true, receive_messages: true)
for message <- stream do
case message do
warning = %ExTwitter.Model.StallWarning{} ->
IO.inspect warning
_ ->
:timer.sleep(1000)
end
end
Please let me close at the moment (with mock test), and reopen if any issue are found.
from extwitter.
Related Issues (20)
- Twitter Streaming API can return multiple portions of tweets in a given chunk HOT 4
- Poison.decode with `keys: :atoms` is unsafe
- search_next_results does not pass on certain opts
- The max_id on the search_metadata is incorrect HOT 1
- Docs do not generate on Elixir 1.8.x HOT 2
- Streaming specs fail on Elixir 1.8.x HOT 1
- Direct Messages no longer working
- How do we get the URL of a tweet after using ExTwitter.update/1? HOT 1
- Replace Poison with Jason HOT 2
- Email field missing from ExTwitter.Model.User HOT 1
- Add LICENSE file HOT 2
- New API 2 paths does not work with request function HOT 3
- Jason.DecodeError occurs for deleted Tweets HOT 4
- Where is full_text / extended_tweet? HOT 2
- Runtime error in OTP 24 HOT 2
- Compilation fails with elixir 1.14 HOT 2
- Twitter api closes down multiple old endpoints at October 31, 2022
- How to call "/users/me"?
- How to get user's last N tweets?
- SSL error on OTP 26
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extwitter.