Esempio n. 1
0
        private static Hashtable ShowPartialMatch(List <ImageResult> images)
        {
            Collection <PartialMatche> objPartialMatch = new Collection <PartialMatche>();
            Hashtable objResults = new Hashtable();

            if (images == null || images.Any() == false)
            {
                return(null);
            }

            foreach (ImageResult objResult in images)
            {
                PartialMatche objItem = new PartialMatche
                {
                    Title    = objResult.Title,
                    ImageUrl = objResult.Thumbnail.MediaUrl,
                    Link     = objResult.MediaUrl
                };

                objPartialMatch.Add(objItem);
            }

            partialMatch objWindow = new partialMatch(objPartialMatch);

            objWindow.Title = "Bing - " + objWindow.Title;
            objWindow.ShowDialog();
            if (string.IsNullOrEmpty(objWindow.SelectedLink) == false)
            {
                objResults.Add("Image", objWindow.SelectedLink);
                objResults.Add("Title", objWindow.SelectedTitle);
            }

            return(objResults);
        }
Esempio n. 2
0
        public static Collection <PartialMatche> MovieToPartialMatche(JObject objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            JArray nodes = (JArray)objRest["results"];

            foreach (var node in nodes)
            {
                PartialMatche objItem = new PartialMatche();

                if (node.HasValues)
                {
                    objItem.Link = (string)node["id"];

                    objItem.Title = (string)node["title"];
                    if (string.IsNullOrWhiteSpace(objItem.Title))
                    {
                        objItem.Title = (string)node["original_title"];
                    }

                    if (node["poster_path"] != null)
                    {
                        objItem.ImageUrl = ImageUrl + SmallImage + (string)node["poster_path"];
                    }

                    lstResults.Add(objItem);
                }
            }
            return(lstResults);
        }
Esempio n. 3
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <ImageResult> images)
        {
            Collection <PartialMatche> objPartialMatch = new Collection <PartialMatche>();

            IEnumerable <ImageResult> imageResults = images.ToArray();

            if (images == null || imageResults.Any() == false)
            {
                return(null);
            }

            foreach (ImageResult objResult in imageResults)
            {
                PartialMatche objItem = new PartialMatche
                {
                    Title    = objResult.Title,
                    ImageUrl = objResult.Thumbnail.MediaUrl,
                    Link     = objResult.MediaUrl
                };

                objPartialMatch.Add(objItem);
            }

            return(objPartialMatch);
        }
Esempio n. 4
0
        public static Collection <PartialMatche> MovieToPartialMatche(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("movie")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Title = Util.GetElementValue(objTemp, "name");
                objItem.Link  = Util.GetElementValue(objTemp, "id");

                var imagesUrl = from item in objTemp.Descendants("image")
                                let attribute = item.Attribute("type")
                                                let xAttribute = item.Attribute("size")
                                                                 where attribute != null && (xAttribute != null && (attribute.Value == "poster" &&
                                                                                                                    xAttribute.Value == "thumb"))
                                                                 let xAttribute1 = item.Attribute("url")
                                                                                   where xAttribute1 != null
                                                                                   select xAttribute1.Value;

                string[] images = imagesUrl.ToArray();
                if (images.Length > 0)
                {
                    objItem.ImageUrl = images[0];
                }

                lstResults.Add(objItem);
            }
            return(lstResults);
        }
Esempio n. 5
0
        private static Artist ShowPartialMatchArtist(IEnumerable <TMDB> lstItems)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (TMDB item in lstItems)
            {
                PartialMatche objMatche = new PartialMatche();

                objMatche.Link     = item.Id;
                objMatche.ImageUrl = item.PosterThumb;
                objMatche.Title    = Util.PurgeHtml(item.Title);

                lstMatche.Add(objMatche);
            }


            partialMatch objWindow = new partialMatch(lstMatche, Provider.Tvdb);

            objWindow.Title = "www.themoviedb.org" + " - " + objWindow.Title;
            objWindow.ShowDialog();

            if (string.IsNullOrEmpty(objWindow.SelectedLink) == false)
            {
                return(GetArtist(objWindow.SelectedLink));
            }

            return(null);
        }
Esempio n. 6
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> strResults)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in strResults)
            {
                string strTemp    = item.Trim();
                string strParsing = @"<a href=""preview";

                if (strTemp.StartsWith(strParsing))
                {
                    PartialMatche objMatche = new PartialMatche();
                    strTemp        = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing     = @"""";
                    objMatche.Link = @"http://www.tucows.com/preview" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    strTemp = strTemp.Replace("<em>", "");
                    strTemp = strTemp.Replace(@"</em>", "");

                    strParsing      = @">";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"<";
                    objMatche.Title = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 7
0
        private static Artist ShowPartialMatchArtist(IEnumerable <AlloCine> lstItems, LanguageType languageType)
        {
            var lstMatche = new Collection <PartialMatche>();

            foreach (AlloCine item in lstItems)
            {
                var objMatche = new PartialMatche();

                objMatche.Link     = item.Id;
                objMatche.ImageUrl = item.PosterOriginal;
                objMatche.Title    = Util.PurgeHtml(item.Title);

                lstMatche.Add(objMatche);
            }


            partialMatch objWindow = new partialMatch(lstMatche, Provider.AlloCine);

            objWindow.ShowDialog();

            if (string.IsNullOrEmpty(objWindow.SelectedLink) == false)
            {
                return(GetArtist(objWindow.SelectedLink, languageType));
            }

            return(null);
        }
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> objTables)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in objTables)
            {
                string strTemp    = item.Trim();
                string strParsing = @"<table";

                if (strTemp.StartsWith(strParsing))
                {
                    PartialMatche objMatche = new PartialMatche();
                    strParsing = @"<a href=""";
                    strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing = @"""";
                    string strLink = @"http://e.orgazmik.com" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                    objMatche.Link = strLink;

                    strParsing         = @"<img src=""";
                    strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing         = @"""";
                    objMatche.ImageUrl = @"http://e.orgazmik.com" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    strParsing      = @"alt=""";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"""";
                    objMatche.Title = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 9
0
        public static Collection <PartialMatche> SeriesToPartialMatche(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Elements()
                        where item.Name.LocalName == "tvseries"
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Link = Util.GetAttributValue(objTemp, "code");

                objItem.Title = Util.GetElementValue(objTemp, @"{http://www.allocine.net/v6/ns/}title");
                if (string.IsNullOrWhiteSpace(objItem.Title))
                {
                    objItem.Title = Util.GetElementValue(objTemp, @"{http://www.allocine.net/v6/ns/}originalTitle");
                }

                objItem.ImageUrl = Util.GetAttributValue(objTemp, @"{http://www.allocine.net/v6/ns/}poster", "href");

                lstResults.Add(objItem);
            }
            return(lstResults);
        }
Esempio n. 10
0
        public static Collection <PartialMatche> AlbumToPartialMatch(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            List <string> lstTitles = new List <string>();
            var           query     = from item in objRest.Descendants("ALBUM")
                                      select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();
                objItem.Title    = Util.GetElementValue(objTemp, "TITLE");
                objItem.Artist   = Util.GetElementValue(objTemp, "ARTIST");
                objItem.Link     = Util.GetElementValue(objTemp, "GN_ID");
                objItem.ImageUrl = Util.GetElementValue(objTemp, "URL");

                if (lstTitles.Contains(objItem.Title + objItem.Artist) == false)
                {
                    if (string.IsNullOrWhiteSpace(objItem.Link) == false)
                    {
                        lstTitles.Add(objItem.Title + objItem.Artist);
                        lstResults.Add(objItem);
                    }
                }
            }

            return(lstResults);
        }
Esempio n. 11
0
        public static Collection <PartialMatche> SerieToPartialMatche(XElement objRest)
        {
            if (objRest == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("Series")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Title = Util.GetElementValue(objTemp, "SeriesName");
                objItem.Link  = Util.GetElementValue(objTemp, "seriesid");

                string banner = Util.GetElementValue(objTemp, "banner");
                if (!string.IsNullOrEmpty(banner))
                {
                    objItem.ImageUrl = "http://www.thetvdb.com/banners/" + banner;
                }

                lstResults.Add(objItem);
            }
            return(lstResults);
        }
Esempio n. 12
0
        public static Collection <PartialMatche> SeriesToPartialMatche(JObject objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();

            if (objRest["feed"] != null)
            {
                JArray nodes = (JArray)objRest["feed"]["tvseries"];

                if (nodes != null)
                {
                    foreach (JObject node in nodes)
                    {
                        PartialMatche objItem = new PartialMatche();

                        objItem.Link = (string)node["code"];

                        objItem.Title = (string)node["title"];
                        if (string.IsNullOrWhiteSpace(objItem.Title))
                        {
                            objItem.Title = (string)node["originalTitle"];
                        }

                        if (node["poster"] != null)
                        {
                            objItem.ImageUrl = (string)node["poster"]["href"];
                        }

                        lstResults.Add(objItem);
                    }
                }
            }
            return(lstResults);
        }
Esempio n. 13
0
        public static Collection <PartialMatche> ToPartialMatche(JObject objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            JArray nodes = (JArray)objRest["items"];

            if (nodes != null)
            {
                foreach (JObject node in nodes)
                {
                    PartialMatche objItem = new PartialMatche();

                    objItem.Link = (string)node["id"];

                    if (node["creators"]["performers"] != null)
                    {
                        objItem.Title = (string)node["name"] + " - " + (string)node["creators"]["performers"][0]["name"];
                    }
                    else
                    {
                        objItem.Title = (string)node["name"];
                    }

                    if (node["thumbnails"] != null)
                    {
                        objItem.ImageUrl = (string)node["thumbnails"]["100x100"];
                    }

                    lstResults.Add(objItem);
                }
            }
            return(lstResults);
        }
Esempio n. 14
0
        public static Collection <PartialMatche> AppsToPartialMatche(XElement objRest)
        {
            if (objRest == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("program")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Link     = Util.GetAttributValue(objTemp, "id");
                objItem.Title    = Util.GetElementValue(objTemp, "name");
                objItem.ImageUrl = Util.GetElementValue(objTemp, "url_thumbnail");

                lstResults.Add(objItem);
            }
            return(lstResults);
        }
Esempio n. 15
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> strResults)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in strResults)
            {
                string strTemp    = item.Trim();
                string strParsing = @"_";

                if (strTemp.StartsWith(strParsing))
                {
                    PartialMatche objMatche = new PartialMatche();

                    strTemp        = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing     = @"href=""";
                    strTemp        = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing     = @"""";
                    objMatche.Link = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    strParsing         = @"SRC=""";
                    strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing         = @"""";
                    objMatche.ImageUrl = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    strParsing      = @"ALT=""";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"""";
                    objMatche.Title = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 16
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> tableStrings)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in tableStrings)
            {
                string strTemp    = item.Trim();
                string strParsing = @"class=""studio"">";

                if (strTemp.Contains(strParsing))
                {
                    PartialMatche objMatche = new PartialMatche();
                    strParsing = @"<a href=""";
                    strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing = @"""";
                    string strLink = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                    strLink        = strLink.Replace("french", "english");
                    objMatche.Link = strLink;

                    strParsing      = @"title=""";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"""";
                    objMatche.Title = Util.PurgeHtml(strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)));

                    strParsing         = @" style=""background: url(";
                    strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing         = @")";
                    objMatche.ImageUrl = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 17
0
        private static Hashtable ShowPartialMatch(IEnumerable <string> objTables)
        {
            if (objTables == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in objTables)
            {
                string strTemp    = item.Trim();
                string strParsing = @"0.5em";

                if (strTemp.StartsWith(strParsing) == true)
                {
                    PartialMatche objMatche = new PartialMatche();

                    strParsing = @"src=""";

                    int temp = strTemp.IndexOf(strParsing, StringComparison.Ordinal);
                    if (temp > -1)
                    {
                        strTemp            = strTemp.Substring(temp + strParsing.Length);
                        strParsing         = @"""";
                        objMatche.ImageUrl = @"http://www.iafd.com" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                        strParsing = @"href=""";
                        strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing = @"""";
                        string strLink = @"http://www.iafd.com/" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                        objMatche.Link = strLink;

                        strParsing      = @">";
                        strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing      = @"<";
                        objMatche.Title = Util.PurgeHtml(strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)));

                        lstMatche.Add(objMatche);
                    }
                }
            }

            partialMatch objWindow = new partialMatch(lstMatche);

            objWindow.Title = "www.iafd.com" + " - " + objWindow.Title;
            objWindow.ShowDialog();

            if (string.IsNullOrEmpty(objWindow.SelectedLink) == false)
            {
                return(Parse(objWindow.SelectedLink));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 18
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> rows)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();
            int maxRow = 0;

            foreach (string item in rows)
            {
                string strTemp = item.Trim();

                if (strTemp.StartsWith(@"odd"">") || strTemp.StartsWith(@"even"">"))
                {
                    PartialMatche objMatche = new PartialMatche();

                    string strParsing = @"href=""";
                    strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing = @"""";
                    string strLink = @"http://www.imdb.com" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                    objMatche.Link = strLink;

                    strParsing = @"src=""";
                    int intTmp = strTemp.IndexOf(strParsing, StringComparison.Ordinal);
                    if (intTmp > -1)
                    {
                        strTemp    = strTemp.Substring(intTmp + strParsing.Length);
                        strParsing = @"""";
                        string image = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                        image = image.Replace("SY30_SX23_.", "SX80_SY158.");
                        objMatche.ImageUrl = image;
                    }

                    strParsing = @"href";
                    intTmp     = strTemp.IndexOf(strParsing, StringComparison.Ordinal);
                    if (intTmp > -1)
                    {
                        strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing = @">";
                        strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing = @"</a";
                        intTmp     = strTemp.IndexOf(strParsing, StringComparison.Ordinal);

                        if (intTmp > -1)
                        {
                            string title = strTemp.Substring(0, intTmp);
                            objMatche.Title = Util.PurgeHtml(title);

                            lstMatche.Add(objMatche);
                            maxRow++;
                            if (maxRow > 10)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            return(lstMatche);
        }
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> objTables)
        {
            if (objTables == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in objTables)
            {
                string strTemp    = item.Trim();
                string strParsing = @"container";

                if (strTemp.Contains(strParsing) == true)
                {
                    PartialMatche objMatche = new PartialMatche();

                    strParsing = @"href=";

                    int temp = strTemp.IndexOf(strParsing, StringComparison.Ordinal);
                    if (temp > -1)
                    {
                        strTemp    = strTemp.Substring(temp + strParsing.Length);
                        strParsing = @"/";
                        strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);

                        string strLink = string.Format(@"http://www.adultdvdempire.com/itempage.aspx?item_id={0}&partner_id={1}", strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)), "86947268");
                        objMatche.Link = strLink;

                        strParsing      = @"title=""";
                        strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing      = @"""";
                        objMatche.Title = Util.PurgeHtml(strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)));

                        strParsing         = @"src=""";
                        strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing         = @"""";
                        objMatche.ImageUrl = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                        lstMatche.Add(objMatche);
                    }
                }
            }

            return(lstMatche);
        }
Esempio n. 20
0
        public static Collection <PartialMatche> ToPartialMatche(XElement objRest)
        {
            XNamespace naXNamespace = @"http://musicbrainz.org/ns/mmd-2.0#";

            if (objRest == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();

            var query = from item in objRest.Descendants(naXNamespace + "release")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Link = Util.GetAttributValue(node, "id");
                query        = from item in objRest.Descendants(naXNamespace + "artist")
                               select item;

                string     artist         = null;
                XElement[] artistElements = query.ToArray();
                if (artistElements.Any())
                {
                    artist = artistElements[0].Element(naXNamespace + "name").Value;
                }

                if (string.IsNullOrWhiteSpace(artist) == false)
                {
                    objItem.Title = node.Element(naXNamespace + "title").Value + " - " + artist;
                }
                else
                {
                    objItem.Title = node.Element(naXNamespace + "title").Value;
                }

                if (lstResults.Contains(objItem, new PartialMatchComparer()) == false)
                {
                    lstResults.Add(objItem);
                }
            }
            return(lstResults);
        }
Esempio n. 21
0
        public static Collection <PartialMatche> Search(string strSearch)
        {
            try
            {
                strSearch = strSearch.Replace(" ", "+");
                //Fix Since 2.6.0.0
                string strUrl     = string.Format("http://www.sugarvod.com/browse/vod/?search=true&where=title&query={0}", strSearch);
                string strResults = Util.GetHtmlPage(strUrl, Encoding.Default);

                if (strResults.Contains("no items matched") == false)
                {
                    //Fix 2.8.10.0
                    const string strParsing = @"id=""box_cover";
                    string[]     objTables  = Regex.Split(strResults, strParsing);

                    if (objTables.Length > 1)
                    {
                        return(CreatePartialMatch(objTables));
                    }
                    //Fix Since 2.6.7.0
                    else if (strResults.Contains(@"<SPAN CLASS=""details_title_studio_text"">"))
                    {
                        Collection <PartialMatche> collection = new Collection <PartialMatche>();
                        PartialMatche partialMatche           = new PartialMatche();
                        partialMatche.Link  = strUrl;
                        partialMatche.Title = strSearch;
                        collection.Add(partialMatche);
                        return(collection);
                    }
                    else
                    {
                        return(null);
                    }
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Util.LogException(ex, strSearch);
                return(null);
            }
        }
Esempio n. 22
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> objTables)
        {
            if (objTables == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in objTables)
            {
                string strTemp    = item.Trim();
                string strParsing = @"#";

                if (strTemp.StartsWith(strParsing) == true)
                {
                    PartialMatche objMatche = new PartialMatche();

                    strParsing = @"href=""";

                    int temp = strTemp.IndexOf(strParsing, StringComparison.Ordinal);
                    if (temp > -1)
                    {
                        strTemp    = strTemp.Substring(temp + strParsing.Length);
                        strParsing = @"""";
                        string strLink = @"http://www.cduniverse.com" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                        objMatche.Link = strLink;

                        strParsing         = @"src=""";
                        strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing         = @"""";
                        objMatche.ImageUrl = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                        strParsing      = @"alt=""";
                        strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                        strParsing      = @"""";
                        objMatche.Title = Util.PurgeHtml(strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)));

                        lstMatche.Add(objMatche);
                    }
                }
            }

            return(lstMatche);
        }
Esempio n. 23
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> items)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in items)
            {
                string strTemp = item.Trim();
                string parsing = @""">";

                if (strTemp.StartsWith(parsing))
                {
                    PartialMatche objMatche = new PartialMatche();
                    parsing        = @"id=""";
                    strTemp        = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing        = @"""";
                    objMatche.Link = @"http://musique.fnac.com/" + strTemp.Substring(0, strTemp.IndexOf(parsing, StringComparison.Ordinal)) + @"/";

                    parsing            = @"src=""";
                    strTemp            = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing            = @"""";
                    objMatche.ImageUrl = strTemp.Substring(0, strTemp.IndexOf(parsing, StringComparison.Ordinal));

                    parsing         = @"<a href";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing         = @">";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing         = @"<";
                    objMatche.Title = strTemp.Substring(0, strTemp.IndexOf(parsing, StringComparison.Ordinal));

                    parsing          = @"participants dispeblock"">";
                    strTemp          = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing          = @">";
                    strTemp          = strTemp.Substring(strTemp.IndexOf(parsing, StringComparison.Ordinal) + parsing.Length);
                    parsing          = @"<";
                    objMatche.Artist = strTemp.Substring(0, strTemp.IndexOf(parsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }
            return(lstMatche);
        }
Esempio n. 24
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <string> objTables)
        {
            if (objTables == null)
            {
                return(null);
            }

            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in objTables)
            {
                string strTemp    = item.Trim();
                string strParsing = @"<a href=""h";

                if (strTemp.StartsWith(strParsing) == true)
                {
                    PartialMatche objMatche = new PartialMatche();

                    strParsing = @"href=""";
                    strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing = @"""";
                    string strLink = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                    objMatche.Link = strLink;

                    strParsing      = @""">";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"<";
                    objMatche.Title = Util.PurgeHtml(strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal)));

                    string plateform = GetPlateform(strLink);
                    if (string.IsNullOrWhiteSpace(plateform) == false)
                    {
                        objMatche.Title += " - " + plateform;
                    }

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 25
0
        public static Collection <PartialMatche> AppsToPartialMatche(JObject objRest)
        {
            if (objRest == null)
            {
                return(null);
            }
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            JArray nodes = (JArray)objRest["_embedded"]["program"];

            if (nodes != null)
            {
                foreach (JObject node in nodes)
                {
                    PartialMatche objItem = new PartialMatche();

                    objItem.Link  = (string)node["program_id"];
                    objItem.Title = (string)node["title"];
                    lstResults.Add(objItem);
                }
            }
            return(lstResults);
        }
Esempio n. 26
0
        private static Collection <PartialMatche> CreatePartialMatch(string strHtml)
        {
            string strParsing = @"<div>";

            strHtml = strHtml.Substring(strHtml.IndexOf(strParsing, StringComparison.Ordinal));
            string[] strResults = strHtml.Split(new[] { strParsing }, StringSplitOptions.RemoveEmptyEntries);

            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();

            foreach (string item in strResults)
            {
                string strTemp = item.Trim();
                strParsing = @"<a href=""";

                if (strTemp.StartsWith(strParsing))
                {
                    PartialMatche objMatche = new PartialMatche();

                    strTemp    = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing = @"""";
                    string strLink = @"http://www.adultblurayhddvd.com/" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));
                    objMatche.Link = strLink;

                    strParsing      = @"title=""";
                    strTemp         = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing      = @"""";
                    objMatche.Title = strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    strParsing         = @"src=""";
                    strTemp            = strTemp.Substring(strTemp.IndexOf(strParsing, StringComparison.Ordinal) + strParsing.Length);
                    strParsing         = @"""";
                    objMatche.ImageUrl = @"http://www.adultblurayhddvd.com/" + strTemp.Substring(0, strTemp.IndexOf(strParsing, StringComparison.Ordinal));

                    lstMatche.Add(objMatche);
                }
            }

            return(lstMatche);
        }
Esempio n. 27
0
        public static Collection <PartialMatche> albumToPartialMatche(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("Release")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement objTemp = node;

                PartialMatche objItem = new PartialMatche();
                objItem.Link  = Util.GetAttributValue(objTemp, "id");
                objItem.Title = Util.GetAttributValue(objTemp, "title");

                var artist = from item in objTemp.Descendants("Artist")
                             select item;

                XElement[] nodeArtist = artist.ToArray();

                XElement objArtist = nodeArtist[0];
                objItem.Artist = Util.GetAttributValue(objArtist, "name");

                var image = from item in objTemp.Descendants("Image")
                            select item;
                XElement[] nodeImage = image.ToArray();

                if (nodeImage.Any())
                {
                    XElement objImage = nodeImage[nodeImage.Count() - 1];
                    objItem.ImageUrl = Util.GetAttributValue(objImage, "url");
                }

                lstResults.Add(objItem);
            }

            return(lstResults);
        }
Esempio n. 28
0
        public static Collection <PartialMatche> GamesToPartialMatche(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("Game")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();

                objItem.Title = Util.GetElementValue(objTemp, "GameTitle");
                objItem.Link  = Util.GetElementValue(objTemp, "id");

                string plateform = Util.GetElementValue(objTemp, "Platform");

                objItem.Title = objItem.Title + " - " + plateform;

                lstResults.Add(objItem);
            }
            return(lstResults);
        }
Esempio n. 29
0
        public static Collection <PartialMatche> AlbumToPartialMatch(XElement objRest)
        {
            Collection <PartialMatche> lstResults = new Collection <PartialMatche>();
            var query = from item in objRest.Descendants("album")
                        select item;

            XElement[] nodes = query.ToArray();
            foreach (XElement node in nodes)
            {
                XElement      objTemp = node;
                PartialMatche objItem = new PartialMatche();
                objItem.Title    = Util.GetElementValue(objTemp, "name");
                objItem.Artist   = Util.GetElementValue(objTemp, "artist");
                objItem.Link     = Util.GetElementValue(objTemp, "mbid");
                objItem.ImageUrl = Util.GetElementValue(objTemp, "image", "size", "small");

                if (string.IsNullOrWhiteSpace(objItem.Link) == false)
                {
                    lstResults.Add(objItem);
                }
            }

            return(lstResults);
        }
Esempio n. 30
0
        private static Collection <PartialMatche> CreatePartialMatch(IEnumerable <Item> items, AmazonIndex index)
        {
            Collection <PartialMatche> lstMatche = new Collection <PartialMatche>();
            int i = 0;

            foreach (Item item in items)
            {
                PartialMatche objMatche = new PartialMatche();
                string        infos     = string.Empty;

                objMatche.Link = item.ASIN;

                if (item.SmallImage != null)
                {
                    objMatche.ImageUrl = item.SmallImage.URL;
                }

                switch (index)
                {
                case AmazonIndex.Books:
                    if (item.ItemAttributes.Author != null)
                    {
                        foreach (string info in item.ItemAttributes.Author)
                        {
                            i++;
                            infos += info;
                            if (i < item.ItemAttributes.Author.GetLength(0))
                            {
                                infos += "; ";
                            }
                        }
                    }
                    break;

                case AmazonIndex.Music:
                    if (item.ItemAttributes.Artist != null)
                    {
                        foreach (string info in item.ItemAttributes.Artist)
                        {
                            i++;
                            infos += info;
                            if (i < item.ItemAttributes.Artist.GetLength(0))
                            {
                                infos += "; ";
                            }
                        }
                    }
                    break;

                case AmazonIndex.DVD:
                case AmazonIndex.Classical:
                case AmazonIndex.MusicTracks:
                case AmazonIndex.Software:
                    break;

                case AmazonIndex.VideoGames:
                    if (item.ItemAttributes.Platform != null)
                    {
                        foreach (string info in item.ItemAttributes.Platform)
                        {
                            i++;
                            infos += info;
                            if (i < item.ItemAttributes.Platform.GetLength(0))
                            {
                                infos += "; ";
                            }
                        }
                    }
                    break;
                }


                objMatche.Title = item.ItemAttributes.Title;

                if (string.IsNullOrWhiteSpace(infos) == false)
                {
                    objMatche.Title += " - " + infos;
                }

                lstMatche.Add(objMatche);
            }
            return(lstMatche);
        }