当前位置: 首页>>代码示例>>C#>>正文


C# TwitterService.GetTweet方法代码示例

本文整理汇总了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);
        }
开发者ID:slodge,项目名称:tweetsharp,代码行数:26,代码来源:TwitterServiceTests.Client.cs

示例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);
        }
开发者ID:slodge,项目名称:tweetsharp,代码行数:8,代码来源:TwitterServiceTests.Client.cs

示例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);
        }
开发者ID:Gordon-Beeming,项目名称:tweetsharp,代码行数:22,代码来源:TwitterServiceTests.Client.cs

示例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);
        }
开发者ID:nadeemmar,项目名称:tweetsharp,代码行数:9,代码来源:TwitterServiceTests.cs


注:本文中的TwitterService.GetTweet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。