Beispiel #1
0
        public async Task GetGitHubFollowers()
        {
            var github = GitHub();
            var user   = await github.User.Get(Configuration.GetValue <string>("Username1"));

            await _service.SaveData(user.Followers, 4);
        }
Beispiel #2
0
        public async Task CheckConsumption(int Id, IEnumerable <Consumption> consumption)
        {
            var exist = await _service.Get(Id);

            foreach (var item in consumption)
            {
                if (exist.Any(x => x.Date.Value == item.Start.UtcDateTime.Date))
                {
                    await _service.Delete(Id, item.Start.UtcDateTime);
                }
                await _service.SaveData(item.Quantity, Id, item.Start.UtcDateTime);
            }
        }
Beispiel #3
0
        public async Task GetDevTo()
        {
            var blogs = await BlogService.GetBlogsAsync();

            await _service.SaveData(blogs.Count, 9);

            await _service.SaveData(blogs.Count(x => x.Published), 10);

            int views     = 0;
            int reactions = 0;
            int comments  = 0;

            foreach (var item in blogs)
            {
                views     += item.Page_Views_Count;
                reactions += item.Positive_Reactions_Count;
                comments  += item.Comments_Count;
            }
            await _service.SaveData(views, 11);

            await _service.SaveData(reactions, 12);

            await _service.SaveData(comments, 13);
        }
Beispiel #4
0
 public async Task GetTwitterFollowers()
 {
     var followers = (await TwitterClient.Users.GetFollowerIdsAsync(Configuration.GetValue <string>("Username1"))).Length;
     await _service.SaveData(followers, 0);
 }