I have been developing a similar thing some time ago and i don't think that there are such gems available for the things you need. It's too complex to be handled by a gem. If you want it to work in a similar manner to twitter, here is how i would do that:
1. Posts tagging
Let's say we have a Post
model with body
param. First, to add a tagging functionality, we should enable acts_as_taggable_on
gem for our Post
model which will give us few methods, like tag_list
for instance. When that's ready, we need to somehow obtain hashtags provided in a body
field and save them as tag_list
.
My solution for that was to use a twitter-text-rb gem. Using a following code snippet, you can extract hash tags from a body
field and save them to tag_list
.
def extract_tags(post)
include Twitter::Extractor
tags = extract_hashtags(post.body)
post.update_attribute(:tag_list, tags)
end
And from that point, we're able to search for posts tagged with certain tags using acts_as_taggable_on
built-in methods Post.tagged_with('#first')
2. Users mentioning
I've never been doing such thing but as i can see, the twitter-text-rb
gem also helps with extracting mentions. I'm also not sure what you're trying to accomplish and how that exactly should work but knowing that the previously mentioned gem can help you with extracting mentions and knowing how to deal with tags, it should not be a big deal for you to deal with that ;)
Hope that helps