Closed Californ1a closed 5 years ago
Interesting! I like this idea! Could you give me a specific example of an API that would make sense for me to show this with? The less authentication required the better 😄
Any RSS feed would probably work well as a simple demo without having to deal with an actual REST api and auth, although RSS feeds are typically xml instead of json, so you'd probably have to do xml parsing, and you'd have to find one you could easily insert new entries into for testing/demo. Alternatively, and maybe a better option, you could reference your playlist on creating a REST api, and fetch from something similar to that, though altered a little in order to give new entries on future calls instead of being a predefined word and count (so you have a reason to want to use a Stream). Third option even simpler than those two would be to just use express to serve a text or json file, and then building a Stream to get changes/new entries from the file since the last fetch (and emitting an event when changes are detected).
Labeling this as "Part 2" for now. I like the idea of doing this, but at the moment it's a little out of scope for the current examples described in #12. Although who knows maybe I'll need to simulate 'streaming' in one of these, we'll see!
closing the for next time issues but hope to come back to these!
Oftentimes, an api will be available in REST format without a Stream option, so you have to query the REST api every so often to get updates from it. It would be nice to see this included - working around rate limits and such in order to convert a REST api into your own Stream to use.