本文整理汇总了C#中TwitterService.GetTweet方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.GetTweet方法的具体用法?C# TwitterService.GetTweet怎么用?C# TwitterService.GetTweet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwitterService
的用法示例。
在下文中一共展示了TwitterService.GetTweet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_get_media_links_from_entities
public void Can_get_media_links_from_entities()
{
var service = new TwitterService(_consumerKey, _consumerSecret);
service.AuthenticateWith(_accessToken, _accessTokenSecret);
var tweet = service.GetTweet(128818112387756032);
Assert.IsNotNull(tweet.Entities);
Assert.AreEqual(1, tweet.Entities.Media.Count);
var media = tweet.Entities.Media[0];
Assert.AreEqual("http://p.twimg.com/AcmnZAXCMAEaDD1.jpg", media.MediaUrl);
Assert.AreEqual("https://p.twimg.com/AcmnZAXCMAEaDD1.jpg", media.MediaUrlHttps);
Assert.AreEqual("http://twitter.com/sarah_hatton/status/128818112387756032/photo/1", media.ExpandedUrl);
Assert.AreEqual("pic.twitter.com/xCdS2Emt", media.DisplayUrl);
Assert.AreEqual(TwitterMediaType.Photo, media.MediaType);
Assert.AreEqual(69, media.Indices[0]);
Assert.AreEqual(89, media.Indices[1]);
Assert.AreEqual("128818112391950337", media.IdAsString);
Assert.AreEqual(128818112391950337, media.Id);
// Sizes
Assert.AreEqual(4, media.Sizes.Count());
Assert.AreEqual("fit", media.Sizes.Large.Resize);
Assert.AreEqual(597, media.Sizes.Large.Height);
Assert.AreEqual(800, media.Sizes.Large.Width);
}
示例2: Can_support_secure_urls_in_entitities
public void Can_support_secure_urls_in_entitities()
{
var service = new TwitterService(_consumerKey, _consumerSecret);
service.AuthenticateWith(_accessToken, _accessTokenSecret);
var tweet = service.GetTweet(131501393033961472);
Console.WriteLine(tweet.RawSource);
}
示例3: Can_get_geo_coordinates_from_specific_tweet
public void Can_get_geo_coordinates_from_specific_tweet()
{
var service = new TwitterService(_consumerKey, _consumerSecret);
service.AuthenticateWith(_accessToken, _accessTokenSecret);
/*
"geo": {
"type": "Point",
"coordinates": [
46.01364037,
-81.40501187
]
},
*/
var last = service.GetTweet(new GetTweetOptions { Id = 133314374797492224 });
Assert.IsNotNull(last.Place);
Assert.IsNotNull(last.Location);
Assert.AreEqual("Point", last.Location.Type);
Assert.AreEqual(46.01364037, last.Location.Coordinates.Latitude);
Assert.AreEqual(-81.40501187, last.Location.Coordinates.Longitude);
}
示例4: Can_get_tweet
public void Can_get_tweet()
{
var service = new TwitterService();
var tweet = service.GetTweet(10080880705929216);
Assert.IsNotNull(tweet);
Assert.IsNotNull(service.Response);
Assert.AreEqual(HttpStatusCode.OK, service.Response.StatusCode);
}