使用 API1.1 和 twitterizer 2.4.3 在我关注的地方获取新推文
Get new tweet where I am a following, using API1.1 and twitterizer 2.4.3
我这样提取自己创建的推文:
OAuthTokens tokens = (OAuthTokens)context.Session["OAuthTokens"];
string username ="my_name";
string APIBaseAddress =
"https://api.twitter.com/1.1/statuses/user_timeline.json?
screen_name=" + username+"&count=50";
Uri Uri = new Uri(APIBaseAddress);
WebRequestBuilder requestBuilder =
new WebRequestBuilder(Uri, HTTPVerb.GET, tokens);
using (HttpWebResponse response = requestBuilder.ExecuteRequest())
{
System.IO.StreamReader rdr = new
System.IO.StreamReader(response.GetResponseStream());
dynamic jSon = JsonConvert.DeserializeObject(rdr.ReadToEnd());
}
如何获取我关注的人的新推文?
就用这个url:
https://api.twitter.com/1.1/statuses/home_timeline.json?count=50
而不是 APIBaseAddress
我这样提取自己创建的推文:
OAuthTokens tokens = (OAuthTokens)context.Session["OAuthTokens"];
string username ="my_name";
string APIBaseAddress =
"https://api.twitter.com/1.1/statuses/user_timeline.json?
screen_name=" + username+"&count=50";
Uri Uri = new Uri(APIBaseAddress);
WebRequestBuilder requestBuilder =
new WebRequestBuilder(Uri, HTTPVerb.GET, tokens);
using (HttpWebResponse response = requestBuilder.ExecuteRequest())
{
System.IO.StreamReader rdr = new
System.IO.StreamReader(response.GetResponseStream());
dynamic jSon = JsonConvert.DeserializeObject(rdr.ReadToEnd());
}
如何获取我关注的人的新推文?
就用这个url:
https://api.twitter.com/1.1/statuses/home_timeline.json?count=50
而不是 APIBaseAddress