示例#1
0
        public static void ClearOrdersManually([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "utils/orders/clear")] HttpRequest req, ILogger log)
        {
            string sqlConnectionString = Environment.GetEnvironmentVariable("SQLConnectionString");

            TrendLibrary.ClearOrders(sqlConnectionString);
            log.LogInformation($"C# ClearOrders HTTP trigger function executed at: {DateTime.Now}");
        }
示例#2
0
        static async Task Main(string[] args)
        {
            var            builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
            IConfiguration config  = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build();

            string sqlConnectionString      = config["SQLConnectionString"];
            string twitterConsumerKey       = config["TwitterConsumerKey"];
            string twitterConsumerSecret    = config["TwitterConsumerSecret"];
            string twitterAccessToken       = config["TwitterAccessToken"];
            string twitterAccessTokenSecret = config["TwitterAccessTokenSecret"];

            while (true)
            {
                Console.Write("Enter Text: ");
                string q = Console.ReadLine();
                //var tweets = await TrendLibrary.GetTweetsAsync(q, 10, twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret);
                var retval = await TrendLibrary.GetVaderAsync(q);

                Console.WriteLine($"({q}) Score: {retval}");
            }

            //string content = await TrendLibrary.LoadTweetVolumeAsync("Trump2019", twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret);
            //TrendLibrary.LoadUserTrends(sqlConnectionString, twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret, (err) => Console.WriteLine(err));
            TrendLibrary.LoadTrends(sqlConnectionString, twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret, (err) => Console.WriteLine(err));
        }
示例#3
0
        public static void LoadTrendsManually([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "utils/trends/load")] HttpRequest req, ILogger log)
        {
            string sqlConnectionString      = Environment.GetEnvironmentVariable("SQLConnectionString");
            string twitterConsumerKey       = Environment.GetEnvironmentVariable("TwitterConsumerKey");
            string twitterConsumerSecret    = Environment.GetEnvironmentVariable("TwitterConsumerSecret");
            string twitterAccessToken       = Environment.GetEnvironmentVariable("TwitterAccessToken");
            string twitterAccessTokenSecret = Environment.GetEnvironmentVariable("TwitterAccessTokenSecret");

            TrendLibrary.LoadTrends(sqlConnectionString, twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret, err => log.LogInformation(err));
            //TrendLibrary.LoadUserTrends(sqlConnectionString, twitterConsumerKey, twitterConsumerSecret, twitterAccessToken, twitterAccessTokenSecret, err => log.LogInformation(err));
            log.LogInformation($"C# LoadTrends HTTP trigger function executed at: {DateTime.Now}");
        }