public static TelechargementPlus_PostDetail LoadPostDetailFromWeb(pb.Web.v1.RequestFromWeb_v2 request) { XXElement xeSource = new XXElement(request.GetXmlDocument().Root); TelechargementPlus_PostDetail data = new TelechargementPlus_PostDetail(); data.sourceUrl = request.Url; data.loadFromWebDate = DateTime.Now; XXElement xePost = xeSource.XPathElement("//div[@id='dle-content']"); XXElement xe = xePost.XPathElement(".//div[@class='heading']//div[@class='binner']"); // xe.XPathValue(".//text()", TelechargementPlus.TrimFunc1) data.title = TelechargementPlus.ExtractTextValues(data.infos, TelechargementPlus.TrimFunc1(xe.XPathValue(".//text()"))); data.creationDate = TelechargementPlus.ParseDateTime(xe.XPathValue(".//a//text()")); //data.category = xe.DescendantTextList(".//div[@class='storeinfo']").Skip(2).Select(TelechargementPlus.TrimFunc1).Where(s => s != "E-Book / Magazines" && s != "Catégorie:" && s != "").zToStringValues("/"); data.category = xe.XPathElements(".//div[@class='storeinfo']").DescendantTexts().Skip(2).Select(TelechargementPlus.TrimFunc1).Where(s => s != "E-Book / Magazines" && s != "Catégorie:" && s != "").zToStringValues("/"); //<div class="base"> // <div class="heading"> // <div class="binner"> // <h1> // Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct] Gratuit</h1> // <div class="storeinfo"> // <a href="http://www.telechargement-plus.com/2013/10/14/">Aujourd'hui, 11:59</a> // | Catégorie: // <a href="http://www.telechargement-plus.com/e-book-magazines/">E-Book / Magazines</a>, // <a href="http://www.telechargement-plus.com/e-book-magazines/journaux/">Journaux</a>, // <a href="http://www.telechargement-plus.com/e-book-magazines/magazines/">Magazines</a> // <!-- | Views: 16--> // </div> // </div> // </div> // <div class="maincont"> // <div class="binner"> // <div class="shortstory"> // <div class="story-text"> // <center> // <span id="post-img"> // <img src="/templates/film-gratuit/images/prez/livre.png" alt="E-Book / Magazines, Journaux, Magazines" /> // </span> // </center> // <span id="post-img"> // <div style="text-align: center;"> // <br /> // <!--dle_image_begin:http://www.hapshack.com/images/TX72Y.jpg|--> // <img src="http://www.hapshack.com/images/TX72Y.jpg" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // <br /> // <br /> // <b>Editeur :</b> Presse Fr<br /> // <b>Date de sortie :</b> 2013 // <br /> // <b>H�bergeur : </b>Multi / // <b> // <!--colorstart:#FF0000--> // <span style="color: #FF0000"> // <!--/colorstart--> // [Link Direct]<!--colorend--> // </span><!--/colorend--> // </b> // <br /> // <br /> // <!--dle_image_begin:http://prezup.eu/prez/infossurlebook.png|--> // <img src="http://prezup.eu/prez/infossurlebook.png" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // <br /> // <br /> // <b>Advanced Cr�ation Photoshop HS�rie N�19 - Novembre 2013 [Lien Direct]</b> // <br /> // PDF | French | 186 pages | 100 MB<br /> // <br /> // <b>Le CD | zipper/22 Fichiers &+ | 520 MB</b><br /> // 37 Projets complets<br /> // SAVOIR TOUT FAIRE : Avec Photoshop Volume XIII<br /> // SPECIAL PHOTOMONTAGE & PEINTURE NUMERIQUE<br /> // BONUS : 2 Tutoriels Illustrator<br /> // / / / // <br /> // <br /> // </div> // </span> // <span id="post-img"> // <div id="news-id-86887" style="display: inline;"> // *<br /> // *<br /> // *<br /> // <div style="text-align: center;"> // <b> // <!--sizestart:6--> // <span style="font-size: 24pt;"> // <!--/sizestart--> // <!--colorstart:#FF6600--> // <span style="color: #FF6600"> // <!--/colorstart--> // Cloudzer<!--colorend--> // </span><!--/colorend--><!--sizeend--> // </span><!--/sizeend--> // = // <!--colorstart:#FF0000--> // <span style="color: #FF0000"> // <!--/colorstart--> // [Link Direct]<!--colorend--> // </span><!--/colorend--> // </b> // <br /> // <br /> // <a href="http://clz.to/q83zrwga" target="_blank"> // <!--dle_image_begin:http://www.hapshack.com/images/0THnp.gif|--> // <img src="http://www.hapshack.com/images/0THnp.gif" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // </a> // <br /> // <a href="http://ul.to/ukqruco3" target="_blank"> // <!--dle_image_begin:http://www.hapshack.com/images/9MfYk.gif|--> // <img src="http://www.hapshack.com/images/9MfYk.gif" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // </a> // <br /> // <br /> // <a href="http://hulkfile.eu/gap3aafrlmaj.html" target="_blank"> // <!--dle_image_begin:http://www.hapshack.com/images/Js84x.jpg|--> // <img src="http://www.hapshack.com/images/Js84x.jpg" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // </a> // <br /> // <br /> // <a href="http://turbobit.net/blki3znuvzeg.html" target="_blank"> // <!--dle_image_begin:http://www.hapshack.com/images/QYeW0.gif|--> // <img src="http://www.hapshack.com/images/QYeW0.gif" alt="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" // title="Advanced Cr�ation Photoshop H-S�rie N�19 - Novembre 2013 [Lien Direct]" /><!--dle_image_end--> // </a> // <br /> // <br /> // *<br /> // *<br /> // <b>Le CD &+ : </b> // <br /> // http://clz.to/o58urag6<br /> // http://ul.to/rpqjypm4<br /> // http://hulkfile.eu/i2k3bbz835zg.html<br /> // http://turbobit.net/v644k3dd8izl.html<br /> // <br /> // <br /> // Bonne lecture<br /> // ************* // </div> // </div> // </span> xe = xePost.XPathElement(".//div[@class='maincont']//div[@class='binner']//div[@class='story-text']"); //data.images = xe.XPathElements(".//span[@id='post-img']").XPathImages(request.Url, TelechargementPlus.ImagesToSkip, node => node is XElement && ((XElement)node).Name == "a" ? false : true); //data.images = xe.XPathElements(".//span[@id='post-img']").XPathImages(request.Url, imageHtml => !TelechargementPlus.ImagesToSkip.ContainsKey(imageHtml.Source), node => node is XElement && ((XElement)node).Name == "a" ? false : true); //data.images = xe.XPathElements(".//span[@id='post-img']").XPathImages(xeImg => new ImageHtml(xeImg, request.Url), imageHtml => !TelechargementPlus.ImagesToSkip.ContainsKey(imageHtml.Source), // node => node is XElement && ((XElement)node).Name == "a" ? false : true).ToList(); //data.images = xe.XPathElements(".//span[@id='post-img']").XPathImages(xeImg => new ImageHtml(xeImg, request.Url), imageHtml => !TelechargementPlus.ImagesToSkip.ContainsKey(imageHtml.Source), // node => node is XElement && ((XElement)node).Name == "a" ? XNodeFilter.SkipNode : XNodeFilter.SelectNode).ToList(); data.images = xe.XPathElements(".//span[@id='post-img']") .DescendantNodes(node => XmlDescendant.ImageFilter(node, node2 => node2 is XElement && ((XElement)node2).Name == "a" ? XNodeFilter.SkipNode : XNodeFilter.SelectNode)) .Select(xeImg => new pb.old.ImageHtml((XElement)xeImg, request.Url)) .Where(imageHtml => !TelechargementPlus.ImagesToSkip.ContainsKey(imageHtml.Source)) .ToList(); if (request.LoadImage) pb.old.Http_v2.LoadImageFromWeb(data.images); //data.SetTextValues(xe.DescendantTextList(".//span[@id='post-img']", node => node is XElement && ((XElement)node).Name == "a" ? false : true)); data.SetTextValues(xe.XPathElements(".//span[@id='post-img']").DescendantTexts(node => node is XElement && ((XElement)node).Name == "a" ? XNodeFilter.SkipNode : XNodeFilter.SelectNode)); data.downloadLinks.AddRange(xe.XPathValues(".//span[@id='post-img']//a/@href")); ////<h1 class="shd"> //// <a href="http://www.telechargement-plus.com/e-book-magazines/magazines/86236-multi-ici-paris-n3562-9-au-15-octobre-2013.html"> //// [Multi] Ici Paris N°3562 - 9 au 15 Octobre 2013 //// </a> ////</h1> //XXElement xe = xePost.XPathElement(".//*[@class='shd']//a"); //_print.url = xe.XPathValue("@href"); //_print.title = TrimString(ExtractTextValues(xe.XPathValue(".//text()"))); ////<div class="shdinf"> //// <div class="shdinf"> //// <span class="rcol">Auteur: //// <a onclick="ShowProfile('bakafa', 'http://www.telechargement-plus.com/user/bakafa/', '0'); return false;" href="http://www.telechargement-plus.com/user/bakafa/"> //// bakafa //// </a> //// </span> //// <span class="date"> //// <b><a href="http://www.telechargement-plus.com/2013/10/09/">Aujourd'hui, 17:13</a></b> //// </span> //// <span class="lcol">Catégorie: //// <a href="http://www.telechargement-plus.com/e-book-magazines/"> //// E-Book / Magazines //// </a> » //// <a href="http://www.telechargement-plus.com/e-book-magazines/magazines/"> //// Magazines //// </a> //// </span> //// </div> ////</div> //xe = xePost.XPathElement(".//div[@class='shdinf']/div[@class='shdinf']"); //_print.postAuthor = xe.XPathValue(".//span[@class='rcol']//a//text()"); //string postDate = xe.XPathValue(".//span[@class='date']//text()"); //// Aujourd'hui, 17:13 //if (postDate != null) // _print.infos.SetValue("postDate", new ZString(postDate)); //_print.category = xe.DescendantTextList(".//span[@class='lcol']").Select(s => TrimString(s)).Where(s => s != "E-Book / Magazines" && s != "Catégorie:" && s != "").zToStringValues("/"); ////.zForEach(s => s.Trim()) ////<span id="post-img"> //// <div id="news-id-86236" style="display: inline;"> //// <div style="text-align: center;"> //// <!--dle_image_begin:http://zupimages.net/up/3/1515486591.jpeg|--> //// <img src="http://zupimages.net/up/3/1515486591.jpeg" alt="[Multi] Ici Paris N°3562 - 9 au 15 Octobre 2013" //// title="[Multi] Ici Paris N°3562 - 9 au 15 Octobre 2013" /><!--dle_image_end--> //// <br /> //// <b> //// <br /> //// Ici Paris N°3562 - 9 au 15 Octobre 2013<br /> //// French | 52 pages | HQ PDF | 101 MB //// </b> //// <br /> //// <br /> //// Ici Paris vous fait partager la vie publique et privée de celles et ceux qui font //// l'actualité : exclusivités, interviews, enquêtes (la face cachée du showbiz, les //// coulisses de la télé) indiscrétions, potins.<br /> //// </div> //// </div> ////</span> //xe = xePost.XPathElement(".//span[@id='post-img']//div[starts-with(@id, 'news-id')]"); //_print.images = xe.XPathImages(".//img", _imagesToSkip); //if (_loadImage) // Http2.LoadImageFromWeb(_print.images); return data; }
public static RapideDdl_PostDetail LoadPostDetailFromWeb(pb.Web.v1.RequestFromWeb_v2 request) { XXElement xeSource = new XXElement(request.GetXmlDocument().Root); RapideDdl_PostDetail data = new RapideDdl_PostDetail(); data.sourceUrl = request.Url; data.loadFromWebDate = DateTime.Now; XXElement xePost = xeSource.XPathElement("//div[@class='lcolomn mainside']"); //data.category = xePost.DescendantTextList(".//div[@class='spbar']//a").Select(Download.Print.RapideDdl.RapideDdl.TrimFunc1).Where(s => s != "Accueil" && s != "").zToStringValues("/"); data.category = xePost.XPathElements(".//div[@class='spbar']//a").DescendantTexts().Select(Download.Print.RapideDdl.RapideDdl.TrimFunc1).Where(s => s != "Accueil" && s != "").zToStringValues("/"); //data.title = RapideDdl.ExtractTextValues(data.infos, xePost.XPathValue(".//div[@class='base fullstory']//text()", RapideDdl.TrimFunc1)); //data.title = xePost.DescendantTextList(".//div[@class='spbar']", node => !(node is XElement) || ((XElement)node).Name != "a", RapideDdl.TrimFunc1).FirstOrDefault(); //data.title = xePost.XPathValue(".//div[@class='spbar']/text()", RapideDdl.TrimFunc1); //data.title = xePost.DescendantTextList(".//div[@class='spbar']", func: Download.Print.RapideDdl.RapideDdl.TrimFunc1).LastOrDefault(); data.title = xePost.XPathElements(".//div[@class='spbar']").DescendantTexts().Select(Download.Print.RapideDdl.RapideDdl.TrimFunc1).LastOrDefault(); XXElement xe = xePost.XPathElement(".//div[@class='shdinfo']"); //////////////data.creationDate = Download.Print.RapideDdl.RapideDdl.ParseDateTime(xe.XPathValue(".//span[@class='date']//text()"), (DateTime)data.loadFromWebDate); data.postAuthor = xe.XPathValue(".//span[@class='arg']//a//text()"); xe = xePost.XPathElement(".//div[@class='maincont']"); //data.images = xe.XPathImages(request.Url, nodeFilter: node => node is XElement && ((XElement)node).Name == "a"); //data.images = xe.XPathImages(request.Url); //data.images = xe.XPathImages(xeImg => new ImageHtml(xeImg, request.Url)).ToList(); data.images = xe.DescendantNodes(node => XmlDescendant.ImageFilter(node)).Select(xeImg => new pb.old.ImageHtml((XElement)xeImg, request.Url)).ToList(); //if (request.LoadImage) // force load image to get image width and height pb.old.Http_v2.LoadImageFromWeb(data.images); //data.SetTextValues(xe.DescendantTextList(".//span[@id='post-img']", node => node is XElement && ((XElement)node).Name == "a" ? false : true)); //data.SetTextValues(xe.DescendantTextList(".//div")); data.SetTextValues(xe.XPathElements(".//div").DescendantTexts()); //data.downloadLinks.AddRange(xe.XPathValues(".//div[2]//a/@href")); //foreach (XXElement xe2 in xe.XPathElements("div/div").Skip(1)) foreach (XXElement xe2 in xe.XPathElements("div/div")) { // http://prezup.eu http://pixhst.com/avaxhome/27/36/002e3627.jpeg http://www.zupmage.eu/i/R1UgqdXn4F.jpg // http://i.imgur.com/Gu7hagN.jpg http://img11.hostingpics.net/pics/591623liens.png http://www.hapshack.com/images/jUfTZ.gif // http://pixhst.com/pictures/3029467 //data.downloadLinks.AddRange(xe2.XPathValues(".//a/@href").Where(url => !url.StartsWith("http://prezup.eu") && !url.StartsWith("http://pixhst.com") && !url.StartsWith("http://www.zupmage.eu"))); data.downloadLinks.AddRange(xe2.XPathValues(".//a/@href").Where(url => !url.StartsWith("http://prezup.eu") && !url.StartsWith("http://pixhst.com") && !url.EndsWith(".jpg") && !url.EndsWith("jpeg") && !url.EndsWith("png") && !url.EndsWith("gif"))); } return data; }