Hi, Robert:
When you say "any idea", you leave the door wide open!
The key point here, I think, is "trending". If you can get a list of "trending words", this task becomes a question about finding those words within the news stories' texts.
So, here are a couple of ideas. I became aware some time back that it is possible to actually pull a twitter feed. You become a "twitter developer" (I got the details from a course I audited), and then you can grab tweets as they come along. If you did that, you could keep your own trend.
However, there are probably ways to pull just the trending words from some source. I do not know where that would be. Maybe a different twitter feed is targeted that way?
Once you have those trending words, depending on how many there are, you would need to save an "index" (if there are not too many, you could just use a Java collection where it is possible to lookup the value--even a simple Map<
String,Integer> should probably work if you don't need more info). You would want to then run through the words in your story, checking to see which word has the highest (the value from the Map) trend value. Once you have that, you can use it for your hashtag.
I hope that helps.