Is it possible to select only pictures with certain hashtags from a user using the instagram gem? Couldn’t find hashtag select in the docs. If so, please provide an example.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It can’t be done directly. The Instagram API itself doesn’t let you make a call like this- you have to either query a particular user’s photos, or query a tag, and the gem provides no workaround.
So, first query the user:
Then keep the photos with the tags you want. In the results, each element has a “tags” array. For example
@results.first["tags"]returns the array of tags for the first photo.Here’s the well-documented code for making typical queries:
https://github.com/Instagram/instagram-ruby-gem/blob/master/lib/instagram/client/users.rb