0
使用instagram文檔我試圖計算用戶的subscribers.token列表是否正確返回,但如果我嘗試獲取用戶列表,它總是出現錯誤400代碼。 如果有人發現如何解決這個問題,請告訴我如何。我嘗試了instasharp,但無法弄清楚如何使用'訂閱者輸出方法'。對於初學者來說,互聯網沒有很好的例子。使用庫xNetinstagram api。熱得到用戶的用戶列表?
public string tok = Gettoken();
private void button1_Click(object sender, EventArgs e)
{
File.WriteAllText("tokken.txt", followby());
//MessageBox.Show(Gettoken());
}
public static string Gettoken()
{
string clientID = "**********************";
string clientSecret = "****************";
string redirect_uri = "https://localhost";
var info = "https://api.instagram.com/oauth/authorize/?client_id=" + clientID + "&redirect_uri=" + redirect_uri + "&response_type=token";
var request = new HttpRequest();
request.UserAgent = HttpHelper.ChromeUserAgent();
HttpResponse response = request.Get(string.Format(info));
string str = response.ToString();
string pattern = @"([0-9a-f]{32})";
Regex regex = new Regex(pattern);
Match match = regex.Match(str);
return match.Groups[1].Value.ToString();
}
string followby()
{
var info = "https://api.instagram.com/v1/users/23423443/follows?access_token=" + tok;
var request = new HttpRequest();
request.UserAgent = HttpHelper.ChromeUserAgent();
HttpResponse response = request.Get(string.Format(info)); //error
return response.ToString();
}