private void FetchTwitterTrends(double latitude, double longitude, long woeId)
        {
            var placeTrends = Trends.GetTrendsAt(woeId);
            var twitterTrendingData = new TwitterTrendingData { Trends = new List<TrendData>() };
            foreach (var item in placeTrends.Trends)
            {
                twitterTrendingData.TimeId = placeTrends.AsOf;
                var trendData = new TrendData { Name = item.Name };

                var searchParameter = Search.CreateTweetSearchParameter(item.Name);

                // searchParameter.MaximumNumberOfResults = 500;
                ICoordinates coord = new Coordinates(longitude, latitude);
                searchParameter.SetGeoCode(coord, 50000, DistanceMeasure.Miles);
                var tweets = Search.SearchTweets(searchParameter);

                trendData.Tweets = new List<MyTweet>();
                foreach (var tweet in tweets)
                {
                    var myTweet = new MyTweet
                    {
                        Latitude = tweet.Coordinates.Latitude,
                        Longitude = tweet.Coordinates.Longitude,
                        Text = tweet.Text
                    };
                    trendData.Tweets.Add(myTweet);
                }

                twitterTrendingData.Trends.Add(trendData);
            }
        }
Exemplo n.º 2
0
 public GeoCode(double longitude, double latitude, double radius, DistanceMeasure distanceMeasure)
 {
     Coordinates = new Coordinates(longitude, latitude);
     Radius = radius;
     DistanceMeasure = distanceMeasure;
 }
Exemplo n.º 3
0
 public Location(double longitude1, double latitude1, double longitude2, double latitude2)
 {
     Coordinate1 = new Coordinates(longitude1, latitude1);
     Coordinate2 = new Coordinates(longitude2, latitude2);
 }