I am using the Twitter gem to generate a list of recent tweets with a specific hashtag that contain images.
It is working fine, but I have noticed that when people append punctuation to the hashtag in their tweets, the API does not include them in my search results. To illustrate, when I search for #sourcecon it does not include tweets that use #sourcecon!
Running separate searches via the API for #sourcecon. or #sourcecon! does not help - it ignores the punctation and generates the same list.
My code is here:
twitter_client.search("'#sourcecon' filter:images", result_type: "recent", :since_id => last_tweet).collect
vs
twitter_client.search("'#sourcecon!' filter:images", result_type: "recent", :since_id => last_tweet).collect
I know that Twitter treats punctuation as not being a part of the hashtag. From the twitter API:
Note that punctuation is not considered to be part of a #hashtag or @mention, so a track term containing punctuation will not match either #hashtags or @mentions.
But shouldn't that mean that it would ignore it completely and return all results (including the ones that include the appended punctuation in the tweets?)
Does anyone know how to get search results here that would include mentions of the hashtag both with and without punctuation at the end?