This code sample will show how you can get weekly trends using REST API. The sample shows another feature of the API where you can specify a criteria to limit the results. You can specify a start date for the report. This is set by calling On method on ITwitterSearchTrends.
static List GetWeeklyTrends(DateTime ? onDate)
{
TwitterClientInfo clientInfo = new TwitterClientInfo();
clientInfo.ClientName = "Marketweet";
clientInfo.ClientUrl = "http://www.byteblocks.com";
clientInfo.ClientVersion = "1.1";
List trendNames = new List();
IFluentTwitter ft = FluentTwitter.CreateRequest(clientInfo);
ft.AuthenticateAs(LOGIN_NAME, PASSWORD);
ITwitterSearchTrends searchTrends = ft.Search().Trends().Weekly();
if (null != onDate)
{
searchTrends.On(onDate.Value).AsJson();
}
var resp = ft.Request();
if (null != resp)
{
var trends = resp.AsTrends();
if (null != trends)
{
foreach (TwitterSearchTrend trend in trends.Trends)
{
trendNames.Add(trend.Name);
}
}
}
return trendNames;
}
Windows Gadget To Display VWorker Recent Open Projects
0x1F is an invalid start of a value
Learn Python: How to ignore SSL verification for HTTP requests
How to host your web site from your home
Automate testing of web page element transition with Selenium
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2022 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use