Get Latest Trends

Oct 7, 2015 at 12:30 PM
Is it possible to get latest trends based on coutry using tweetInivi library??
Coordinator
Oct 7, 2015 at 12:38 PM
Hi,

It is possible to get the trends bases on a WOEID and PlaceId.
All the trends feature have not yet been implemented but please read the following post in order to use each of them:

http://tweetinvi.codeplex.com/discussions/645403

Cheers,
Linvi
Coordinator
Oct 7, 2015 at 2:30 PM
I have created a documentation page that contains almost the same information as the discussion I linked above.
Feel free to have a look there.

https://github.com/linvi/tweetinvi/wiki/Trends

Linvi
Oct 8, 2015 at 11:37 AM
Hi linvi,
          Thanks for the reply. I did understand the logic of the above following code 
public List<string> GetTopTrends()
        {
            var WOEID = String.Format("https://api.twitter.com/1.1/trends/available.json");
            var rWOEID = Tweetinvi.TwitterAccessor.ExecuteGETQuery<IWoeIdLocation[]>(WOEID).Where(x => x.Name == "Lebanon").Select(x => x.WoeId).First();
            var url = String.Format("https://api.twitter.com/1.1/trends/place.json?id={0}", rWOEID.ToString());
            var result = Tweetinvi.TwitterAccessor.ExecuteGETQuery<IPlaceTrends[]>(url).First();
            List<string> TrendsTopic=new List<string>() ;
            for (var i = 0; i < result.Trends.Count(); i++)
            {

                TrendsTopic.Add(result.Trends[i].Name.ToString()) ;

                }

      return TrendsTopic;
but when i execute this code i get following exception
Debugger:Exception Intercepted: GetTopTrends, Trennd.cs line 71
An exception was intercepted and the call stack unwound to the point before the call from user code where the exception occurred.  "Unwind the call stack on unhandled exceptions" is selected in the debugger options.
Time: 10/8/2015 3:31:35 PM
Thread:<No Name>[5224]
at the following line
var rWOEID = Tweetinvi.TwitterAccessor.ExecuteGETQuery<IWoeIdLocation[]>(WOEID).Where(x => x.Name == "Lebanon").Select(x => x.WoeId).First();

Please guide me,ur help will be really apprceiated.