Example #1
0
 public TopMadel(String date, int quantity, String URL)
 {
     vkClient vk = new vkClient();
     top = new List<String>();
     String vkID = vk.GetId(URL);
     DBMaster db = new DBMaster();
     int id = db.FindByIDUser(vkID);
     top = GetTopForDate(date, quantity, id);
 }
Example #2
0
 public List<String> GetTopForDate(String date, int quantity, int idUser)
 {
     Dictionary<int, int> dictionaryTops = new Dictionary<int, int>();
     List<String> tops = new List<String>();
     DBMaster dbMaster = new DBMaster();
     JSONMaster JSON = new JSONMaster();
     dictionaryTops = dbMaster.FindByDate(date, quantity, idUser);
     tops = JSON.GetListTop(dictionaryTops);
     return tops;
 }
Example #3
0
 public List<String> GetListTop(Dictionary<int, int> dictionaryTops)
 {
     List<String> Tops = new List<String>();
     String html = "";
     JObject jsonObj = new JObject();
     HttpMaster httpMaster = new HttpMaster();
     DBMaster dbMaster = new DBMaster();
     foreach (var elementTop in dictionaryTops)
     {
         String vk_id = dbMaster.FindByIdGroup(elementTop.Key);
         html = httpMaster.PageData("groups.getById", "group_id=" + vk_id);
         jsonObj = JObject.Parse(html);
         foreach (var result in jsonObj["response"])
         {
             Tops.Add((String)result["name"]);
         }
     }
     return Tops;
 }