Twitter Parsing

I have the twitter node setup and running. I'm able to get specific tweets, but I'm trying to pull out specific data. In this case, game score.

Does anyone have a working function node example that could help guide me in how to best extract only the data I need?

Thank you!

If you provide example debug output (in text, not screenshot), people perhaps can help you on your way.

Here is an example...all I want is the "31" :slight_smile: I think if I could pull the number between "Alabama" and the dash, I would be okay:

Just get it to DeVonta & he'll do the rest! He takes the 23-yard screen pass for his career-best third touchdown of the game!! Alabama 31 – Ole Miss 10 #BamaFactor #RollTide

Try searching for Natural Language Processing (nlp) contrib nodes. In this specific tweet you could do a substring starting at Alabama, then split on the dash, keeping the first part, followed by stripping off Alabama. Or a specific regex. However the minute the tweet itself is different that won’t work. So you need a setup capable of extracting data out of natural language. I’ve done this in Python with both NLTK and Spacy, but it’s acting a research topic of its own, rather than something that sounds simple to do :slight_smile:

This sounds very interesting. I wasn't able to find any Natural Language nodes...can you point me to the correct one?

I can’t say I’ve done this in node-red or even JavaScript before, but looking at what is available in JS nlp-js looks promising. There’s a contrib node around it, but I haven’t checked out what it exposes.
If you’d like to learn about the topic in general, the NLTK library in Python wrote a book about it (published at O’Reilly but available for free online under a creative commons license), aimed at using nltk with python, but teaching a lot about nlp and nlp strategies in general: https://www.nltk.org/book/

Again, sounds very interesting, but I'm afraid a little over my head from a programming perspective. I was really hoping to repurpose someone else's good work lol.