Getting Twitter Trends

Oct 2, 2013 at 7:31 PM
Hi , i tried the following code to get twitter trends but i got those two errors :

'trends.Location' i got trends does not contain a definition for location and

EmitTrends Does not Exist.

I also tried the other examples and got the same problems.

what should i do?
var trends =
                (from trnd in twitterCtx.Trends
                 where trnd.Type == TrendType.Place &&
                       trnd.WoeID == 2486982 // something other than 1
                 select trnd)
                 .ToList();

            // Location is the same for each trending item, so just read the first
            Console.WriteLine("Location: {0}\n", trends[0].Location.Name);

            trends.ForEach(trnd => EmitTrend(trnd));
Coordinator
Oct 2, 2013 at 7:39 PM
Hi,

The documentation was old. I updated it. Here's a better demo, which you can find in the downloadable source code:
            var trends =
                (from trnd in twitterCtx.Trends
                 where trnd.Type == TrendType.Place &&
                       trnd.WoeID == 2486982 // something other than 1
                 select trnd)
                .ToList();

            Console.WriteLine(
                "Location: {0}\n", 
                trends.First().Locations.First().Name);

            trends.ForEach(trnd => 
                Console.WriteLine(
                    "Name: {0}, Date: {1}, Query: {2}\nSearchUrl: {3}",
                    trnd.Name, trnd.CreatedAt, trnd.Query, trnd.SearchUrl));
@JoeMayo
Oct 3, 2013 at 8:30 AM
Thank you !