Exemplo n.º 1
0
        public IActionResult GetTagByUrl([FromBody] RequestByUrl request)
        {
            var response = _tagRepository.FindByUrl(request.Url);

            if (response == null)
            {
                return(BadRequest("Tag not found"));
            }
            return(Ok(response));
        }
Exemplo n.º 2
0
        public ActionResult GetVideoByUrl([FromBody] RequestByUrl request)
        {
            var response = _fileSaveRepository.GetByUrl(request.Url);

            if (response == null)
            {
                return(BadRequest("Video not found"));
            }
            return(File(response.FileData, response.FileType));
        }
Exemplo n.º 3
0
        public IActionResult GetCategoryByUrl([FromBody] RequestByUrl request)
        {
            var response = _categoryRepository.FindByUrl(request.Url);

            if (response == null)
            {
                return(BadRequest("Category not found"));
            }
            return(Ok(response));
        }
Exemplo n.º 4
0
        private async Task <int> GetIdAccount()
        {
            var html = await RequestByUrl.Get(@"http://acmp.ru/inc/passport.asp?lgn=" + _acmpUserData + "&password="******"<tr><td align=left>ID</td><td style='color: black; font-size: 11pt'>\d*<br></td></tr>");

            var id = regex
                     .Matches(html)[0]
                     .Groups[0]
                     .Value
                     .Replace("<br></td></tr>", "")
                     .Replace("<tr><td align=left>ID</td><td style='color: black; font-size: 11pt'>", "");

            return(int.Parse(id));
        }