6

我正在使用 InstaSharp API 将我的 instagram 中的图片加载到我的网站中。

现在我正在尝试获取包括特定主题标签的所有数据,但我得到的唯一一件事是添加到我的列表()中的一个随机对象(图片数据result.Data)。而且它总是相同的图片(该对象位于特定主题标签的整个对象列表中间的某个位置,而我使用的这个主题标签在 Instagram 上搜索时被点击了 66 次,所以不止 1 个)。

我如何从这个特定的标签中获取所有数据,以便我可以使用所有这些对象?

这是我的代码:

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
    });
}

甚至更好,

如何从特定用户的特定主题标签中获取所有数据,以便我可以使用所有这些对象?

像这样:

var users = new InstaSharp.Endpoints.Users.Authenticated(Config, UserAuthInfo());
var result = users.Recent().Data.Where(o => o.Tags.Any(z => z.Equals("mySpecificHashTag")));

注意:如果我喜欢最后一个,我只会得到特定用户添加的 X 个对象,最后 20 个添加的对象。这意味着:其他 18 个对象没有我想要的主题标签。

4

0 回答 0