I'm using InstaSharp API to load pictures from my instagram into my website.
Now I'm trying to get all data iincluding a specific hashtag, but the only thing I get is one random object(picture-data) added to my list (result.Data
). And it's always the same picture (the object somewhere in the middle of the whole list of objects from the specific hashtag, and this hashtag I'm using is hit 66 times when searching for it on Instagram, so there is more than 1).
How do I get all the data from this specific hashtag, so I can use all these object?
Here is my code:
var users = new InstaSharp.Endpoints.Tags.Authenticated(Config, UserAuthInfo());
//- EDIT - reading the instagram-developer-api, I think this code will order the objects by when
//they are hashtagged. This is not what I want, so the best thig would be to do it something like my last example
//result.Data only gets filled with one of these 66 objects
var result = users.Recent("mySpecificHashTag");
foreach (var item in result.Data)
{
page.InstagramPhotos.Add( new InstagramPhoto()
{
Url = item.Images.StandardResolution.Url
});
}
or even better,
How do I get all the data from specific hashtag from a specific user, so I can use all these object?
Like this:
var users = new InstaSharp.Endpoints.Users.Authenticated(Config, UserAuthInfo());
var result = users.Recent().Data.Where(o => o.Tags.Any(z => z.Equals("mySpecificHashTag")));
Note: If I do like this last one, I only get the X numbers of objects added by the specific users last 20 added objects in all. Which means: the 18 other objects does not have the hashtag I want.