I'm trying to decide if I'll need to write my own Netlify function, or if gatsby-source-twitter has what I need. Instead of a standard q, I'm looking to pull in a curated list of tweets; also called a collection. I was a bit confused on if this source plugin allowed additional complexity, or if it's solely for keywords. Thanks for any guidance!
Hi @zslabs, I can't speak for @G100g who makes gatsby-source-twitter but as I understand it his plugin works for q only.
But regarding your own Netlify function, that might not need to be the case. I suspect you could use a library such as https://github.com/draftbit/twitter-lite and in your gatsby-node file use that library to get the collection information you're after and then making a node for the curated tweets it returns.
You could do that directly in your app's gatsby-node or write it as a source plugin and include that in your app.
Here's some hopefully helpful guidance material:-
Once you've created your nodes via a Twitter library you'll be able to consume it via GraphQL.
Hi @zslabs, I confirm that actually my plugin works only for q queries.
I think that adding collections functionality will be easy.
I will play with it in the next days and and I will release a new beta version.
Do you have some collections example to test?
Thanks.
@zslabs thanks for opening this, and thanks to @G100g for monitoring!
I'm going to close this out--perhaps this is a feature request best made in the gatsby-source-twitter repo, so I'd suggest cross-posting it there.
Thank you!
@G100g Thanks for chiming in on this one! I ended up using the library @andrewfairlie suggested as my needs shifted a bit to having a list of statuses compared to a collection of them.