/// <summary> /// determine whether lainchan or 4chan is being scraped /// </summary> /// <param name="url">Url of website to be scraped</param> private ChanType GetChanType(string url) { if (url.Contains("4chan")) { chanType = ChanType._4chan; } else if (url.Contains("lainchan")) { chanType = ChanType._lainchan; } return(chanType); }
public static string GetHTMLBase(ChanType Chan, ThreadInfo Info) { switch (Chan) { case ChanType.FourChan: string HTMLBase = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta charset=\"utf-8\">\r\n" + "<style> html { -moz-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { background: #1d1f21 none; color: #c5c8c6; font-family: arial, helvetica, sans-serif; font-size: 10pt; margin-left: 0; margin-right: 0; margin-top: 5px; padding-left: 5px; padding-right: 5px; } .CenteredSmall { width: 468px; max-width: 100%; } a, a:visited { color: #81a2be!important; text-decoration: none; } a.replylink:not(:hover), div#absbot a:not(:hover) { color: #81a2be!important; } a:hover { color: #5f89ac!important; } img { border: none; } hr { border: none; border-top: 1px solid #282a2e; height: 0; } div.boardBanner { text-align: center; clear: both; } div.boardBanner>div.boardTitle { font-family: Tahoma, sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -2px; margin-top: 0; } div.boardBanner>div.boardSubtitle { font-size: x-small; } div.post { margin: 5px 0; overflow: hidden; } div.op { display: inline; } div.reply { background-color: #282a2e; border: 1px solid #282a2e; display: table; padding: 2px; } div.post div.postInfo span.nameBlock span.postertrip { color: #c5c8c6; font-weight: 400!important; } div.post div.file .fileThumb { float: left; margin-left: 20px; margin-right: 20px; margin-top: 3px; margin-bottom: 5px; } span.fileThumb { margin-left: 0!important; margin-right: 5px!important; } div.post div.file .fileThumb img { border: none; float: left; } .postblock { background-color: #282a2e; color: #c5c8c6; font-weight: 700; padding: 0 5px; font-size: 10pt; } .reply:target { background: #1d1d21!important; border: 1px solid #111!important; padding: 2px; } .deadlink { text-decoration: line-through; color: #81a2be!important; } .oldpost { color: #c5c8c6; font-weight: 700; } .fileText a { text-decoration: underline; } span.subject{ color:#b294bb;font-weight:700; } </style>\r\n" + "<title></title>\r\n" + "</head>\r\n\r\n<body>\r\n<div class=\"boardBanner\">\r\n<div class=\"boardTitle\">" + Info.ThreadBoard + " - " + Info.BoardName + "</div>\r\n<div class=\"boardSubtitle\">" + BoardSubtitles.GetSubtitle(Chan, Info.ThreadBoard) + "</div>\r\n</div>" + "<hr class=\"CenteredSmall\">"; return(HTMLBase); default: return(null); } }