1
我想用指定的hashtag使用Instasharp库来获取最近的Instagram照片。我的示例应用程序看起来像Instasharp Tags.Recent返回0结果
private void button1_Click(object sender, EventArgs e)
{
GetInstagramPhotosAsync();
}
async void GetInstagramPhotosAsync()
{
string clientId = "...";
string clientSecret = "...";
InstagramConfig config = new InstagramConfig(clientId, clientSecret);
InstaSharp.Endpoints.Tags tags = new InstaSharp.Endpoints.Tags(config);
var result = await tags.Recent("snow");
MessageBox.Show(Convert.ToString(result.Data.Count)); // returns 0
}
但是#snow拥有超过31m的照片!我究竟做错了什么?
UPD: 发现一个问题:一切工作正常使用的clientId从Instasharp分布Instasharp.Tests项目,但不符合我的clientId。
InstagramConfig config = new InstagramConfig();
config.ClientId = "clientId from Instasharp.Tests";
我registred我的应用程序在这里:https://www.instagram.com/developer/clients/manage/,收到一个clientId和我的应用程序中使用它。也许我错过了注册过程中的任何重要步骤?它应该在沙盒模式下工作吗?
更新了问题。 – AndrewR