Ejemplo n.º 1
0
        public IActionResult Post(ScanLinkModel model)
        {
            var link = model.Link;

            if (string.IsNullOrEmpty(link))
            {
                return(this.BadRequest("No Link set"));
            }

            var machineTags = this.taggingProvider.GetTagsForImageUrl(link).ToList();

            if (!machineTags.Any())
            {
                return(this.BadRequest("No MachineTags found :'("));
            }

            var content = this.FindTags(machineTags);

            content.Add("link", link);
            var json = this.Json(content);

            var debugStr = JsonConvert.SerializeObject(content);

            this.storage.Log("web_link", debugStr);

            return(json);
        }
Ejemplo n.º 2
0
        public IActionResult Post(ScanLinkModel model)
        {
            var machineTags = this.taggingProvider.GetTagsForImageUrl(model.Link).ToList();

            if (!machineTags.Any())
            {
                return(this.BadRequest("No MachineTags found :'("));
            }

            var instagramTags = this.repository.FindHumanoidTags(machineTags);

            var content = new Dictionary <string, object>
            {
                { "link", model.Link },
                { "machineTags", machineTags },
                { "instagramTags", instagramTags }
            };

            return(this.Json(content));
        }