Advertisement
AdamBlast

modNewForum.vb

Jul 4th, 2023
1,592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 20.60 KB | None | 0 0
  1. Imports System.Net
  2. Imports System.Text.RegularExpressions
  3. Imports System.Web
  4. Module modNewForum
  5.  
  6.     Public Structure NewForumPostData
  7.         Dim Username As String
  8.         Dim Message As String
  9.         Dim PostNo As Integer
  10.         Dim PostDate As String
  11.     End Structure
  12.  
  13.     Public Structure ThreadTitleAndID
  14.         Dim Author As String
  15.         Dim LastReplyName As String
  16.         Dim LastReplyTime As DateTime
  17.         Dim Title As String
  18.         Dim ID As Integer
  19.         Dim RawPost As String
  20.         Dim URL As String
  21.         Dim TimeCreated As DateTime
  22.         Dim Locked As Boolean
  23.         Dim PostIt As Boolean
  24.         Dim Poll As Boolean
  25.         Dim NoMessages As Integer
  26.         Dim Messages As List(Of NewForumPostData)
  27.     End Structure
  28.  
  29.  
  30.     Public Function GetNewForumLastPage(ByVal intT As Integer) As Integer
  31.         Dim intLastMapPage As Integer = 1
  32.         Try
  33.             Dim wbClient As New WebClient
  34.             Dim strPage As String = wbClient.DownloadString("https://atelier801.com/topic?f=6&t=" & intT)
  35.  
  36.             If Regex.IsMatch(strPage, Regex.Escape("<a class=""btn btn-inverse"" href=""#"" active") & ".*?>" & "(?<pages>.+?)" & "<", RegexOptions.Multiline And RegexOptions.IgnoreCase) Then
  37.                 Dim matchPages As Match = Regex.Match(strPage, Regex.Escape("<a class=""btn btn-inverse"" href=""#"" active") & ".*?>" & "(?<pages>.+?)" & "<", RegexOptions.Multiline And RegexOptions.IgnoreCase)
  38.                 intLastMapPage = matchPages.Groups("pages").Value.Split("/")(1).Trim
  39.             Else
  40.                 intLastMapPage = 1
  41.             End If
  42.         Catch ex As Exception
  43.             intLastMapPage = 1
  44.         End Try
  45.  
  46.         Return intLastMapPage
  47.     End Function
  48.  
  49.     Public Function GetNewFormPosts(ByVal intT As Integer, ByVal intP As Integer) As List(Of NewForumPostData)
  50.         Dim lstNewForumPosts As New List(Of NewForumPostData)
  51.         Dim wbClient As New WebClient
  52.         wbClient.Encoding = System.Text.UTF8Encoding.UTF8
  53.         Dim strPage As String = wbClient.DownloadString("https://atelier801.com/topic?f=6&t=" & intT & "&p=" & intP)
  54.         'https://atelier801.com/topic?f=6&t=48020&p=1
  55.  
  56.         strPage = strPage.Replace(vbLf, "").Replace(vbCr, "")
  57.  
  58.         Dim matchNames As MatchCollection = Regex.Matches(strPage, "<span class=""date-ms hidden"" data-afficher-secondes=""false"">" & "(?<postdate>.+?)" & "</span>" & _
  59. ".*?" & "href=""profile\?pr=" & "(?<user>.+?)" & """>" & _
  60. ".*?" & "<a class=""numero-message""" & ".*?" & """>" & "(?<postno>.+?)" & "</a>" & _
  61. ".*?" & "<div class=""cadre-message-message"">" & "(?<message>.+?)" & "</div>", RegexOptions.Multiline And RegexOptions.IgnoreCase)
  62.  
  63.         'strPage = strPage.Replace(vbLf, "").Replace(vbCr, "")
  64.  
  65.         '        Dim matchNames As MatchCollection = Regex.Matches(strPage, "<span class=""date-ms hidden"" data-afficher-secondes=""false"">" & "(?<postdate>.+?)" & "</span>" & _
  66.         '".*?" & "href=""profile\?pr=" & "(?<user>.+?)" & """>" & _
  67.         '".*?" & "<a class=""numero-message""" & ".*?" & """>" & "(?<postno>.+?)" & "</a>" & _
  68.         '".*?" & "<div id=""message_\d\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?"">" & "(?<message>.+?)" & "</div>", RegexOptions.Multiline And RegexOptions.IgnoreCase)
  69.  
  70.         For Each UserName As Match In matchNames
  71.             Dim currPost As New NewForumPostData
  72.             currPost.Username = StrConv(UserName.Groups("user").Value.Trim, vbProperCase)
  73.             If Regex.IsMatch(currPost.Username, "%2B", RegexOptions.IgnoreCase) Then
  74.                 currPost.Username = Regex.Replace(currPost.Username, "%2B", "", RegexOptions.IgnoreCase)
  75.                 currPost.Username = "+" & StrConv(currPost.Username, vbProperCase)
  76.             End If
  77.             currPost.Message = UserName.Groups("message").Value.Trim
  78.  
  79.             currPost.Message = Regex.Replace(currPost.Message, "<div id="".*?"">", "", RegexOptions.IgnoreCase)
  80.             currPost.Message = Regex.Replace(currPost.Message, "<div>", "", RegexOptions.IgnoreCase)
  81.             currPost.Message = Regex.Replace(currPost.Message, "<span class=""cadre-message-modere-texte"">", "", RegexOptions.IgnoreCase)
  82.             currPost.Message = Regex.Replace(currPost.Message, "</span>", "", RegexOptions.IgnoreCase)
  83.             currPost.PostNo = UserName.Groups("postno").Value.Trim.Replace("#", "")
  84.             currPost.PostDate = UserName.Groups("postdate").Value.Trim
  85.             lstNewForumPosts.Add(currPost)
  86.         Next
  87.  
  88.         Return lstNewForumPosts
  89.     End Function
  90.  
  91.  
  92.  
  93.  
  94.     '    Public Function GetNewFormPosts(ByVal intT As Integer, ByVal intP As Integer) As List(Of NewForumPostData)
  95.     '        Dim lstNewForumPosts As New List(Of NewForumPostData)
  96.     '        Dim wbClient As New WebClient
  97.     '        Dim strPage As String = wbClient.DownloadString("https://atelier801.com/topic?f=6&t=" & intT & "&p=" & intP)
  98.  
  99.     '        strPage = strPage.Replace(vbLf, "").Replace(vbCr, "")
  100.  
  101.     '        Dim matchNames As MatchCollection = Regex.Matches(strPage, "<span class=""date-ms hidden"" data-afficher-secondes=""false"">" & "(?<postdate>.+?)" & "</span>" & _
  102.     '".*?" & "href=""profile\?pr=" & "(?<user>.+?)" & """>" & _
  103.     '".*?" & "<a class=""numero-message""" & ".*?" & """>" & "(?<postno>.+?)" & "</a>" & _
  104.     '".*?" & "<div id=""message_\d\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?\d?"">" & "(?<message>.+?)" & "</div>", RegexOptions.Multiline And RegexOptions.IgnoreCase)
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.     '        For Each UserName As Match In matchNames
  113.  
  114.     '            Dim currPost As New NewForumPostData
  115.     '            currPost.Username = StrConv(UserName.Groups("user").Value.Trim, vbProperCase)
  116.     '            If Regex.IsMatch(currPost.Username, "%2B", RegexOptions.IgnoreCase) Then
  117.     '                currPost.Username = Regex.Replace(currPost.Username, "%2B", "+", RegexOptions.IgnoreCase)
  118.     '            End If
  119.     '            currPost.Message = UserName.Groups("message").Value.Trim
  120.  
  121.     '            currPost.Message = Regex.Replace(currPost.Message, "<div id="".*?"">", "", RegexOptions.IgnoreCase)
  122.     '            currPost.Message = Regex.Replace(currPost.Message, "<div>", "", RegexOptions.IgnoreCase)
  123.     '            currPost.Message = Regex.Replace(currPost.Message, "<span class=""cadre-message-modere-texte"">", "", RegexOptions.IgnoreCase)
  124.     '            currPost.Message = Regex.Replace(currPost.Message, "</span>", "", RegexOptions.IgnoreCase)
  125.     '            currPost.PostNo = UserName.Groups("postno").Value.Trim.Replace("#", "")
  126.     '            currPost.PostDate = UserName.Groups("postdate").Value.Trim
  127.     '            lstNewForumPosts.Add(currPost)
  128.     '        Next
  129.  
  130.     '        Return lstNewForumPosts
  131.     '    End Function
  132.  
  133.     Public Function FormatForumDate(ByVal strDate As String) As String
  134.         Dim currDate As DateTime = ConvertForumTimestamp(strDate)
  135.  
  136.         Dim strOutput As String = currDate.ToString("dd/MM/yyyy HH:mm")
  137.  
  138.         Return strOutput
  139.     End Function
  140.  
  141.     Public Function GetAtelierThreadListNew(ByVal strPage As String, Optional ByVal booIsInbox As Boolean = False) As List(Of ThreadTitleAndID)
  142.         'Replace multiple spaces with single spaces
  143.         strPage = Regex.Replace(strPage, " {2,}", " ")
  144.  
  145.         Dim lstOutput As New List(Of ThreadTitleAndID)
  146.  
  147.         'Match each thread
  148.         Dim matchThreads As MatchCollection = Regex.Matches(strPage, "<a class=""cadre-sujet-titre lien-blanc"" href=""(?<link>.*?)""> ?(<img src=""\/img\/icones\/(?<postIt>postit)\.png"".*?\/>)? ?(<img src=""\/img\/icones\/(?<locked>cadenas)\.png"".*?\/>)? ?(<img src=""\/img\/icones\/(?<poll>sondage)\.png"".*?\/> )?(?<title>.*?)<\/a>.*?<a class=""nombre-messages.*?>(?<noMessages>\d{1,1000})<\/a>.*?<span class=""date-ms hidden"".*?>(?<timeLastReply>.*?)<\/span>.*?<a class=""lien-blanc"" href=""profile\?pr=(?<userName>.*?)"">.*?href=""(?<threadURL>topic\?f=\d\d?&t=(?<threadID>\d{1,10}))"">.*?<span.*?><img src=""img\/icones\/16\/on-offbis(?<online>\d)\.png"".*?>(?<lastReply>.*?)<\/span>.*?date-ms hidden.*?>(?<timeCreated>.*?)<\/span>", RegexOptions.IgnoreCase Or RegexOptions.Singleline Or RegexOptions.Multiline)
  149.         For Each currThread As Match In matchThreads
  150.  
  151.             'WriteLogBalls(currThread.Value & vbNewLine & vbNewLine & vbNewLine)
  152.             Dim newThread As New ThreadTitleAndID
  153.             newThread.ID = currThread.Groups("threadID").Value
  154.             newThread.Title = HttpUtility.HtmlDecode(currThread.Groups("title").Value.Trim)
  155.             newThread.RawPost = currThread.Value
  156.             newThread.URL = "https://atelier801.com/" & currThread.Groups("threadURL").Value
  157.  
  158.             newThread.Author = StrConv(HttpUtility.UrlDecode(currThread.Groups("userName").Value), vbProperCase)
  159.             newThread.TimeCreated = ConvertForumTimestamp(currThread.Groups("timeCreated").Value)
  160.             newThread.LastReplyName = StrConv(HttpUtility.UrlDecode(currThread.Groups("lastReply").Value), vbProperCase)
  161.             newThread.LastReplyTime = ConvertForumTimestamp(currThread.Groups("timeLastReply").Value)
  162.             newThread.NoMessages = CInt(currThread.Groups("noMessages").Value.Trim)
  163.  
  164.             newThread.Locked = currThread.Groups("locked").Value.Length
  165.             newThread.PostIt = currThread.Groups("postIt").Value.Length
  166.             newThread.Poll = currThread.Groups("poll").Value.Length
  167.  
  168.             lstOutput.Add(newThread)
  169.  
  170.             'MsgBox("ID: " & newThread.ID & vbNewLine &
  171.             '       "Title: " & newThread.Title & vbNewLine &
  172.             '       "URL: " & newThread.URL & vbNewLine &
  173.             '       "Author: " & newThread.Author & vbNewLine &
  174.             '       "Time created: " & newThread.TimeCreated.ToString("MMM d, yyyy") & vbNewLine &
  175.             '       "Last reply time: " & newThread.LastReplyTime.ToString("MMM d, yyyy") & vbNewLine &
  176.             '       "Last reply name: " & newThread.LastReplyName & vbNewLine &
  177.             '       "# messages: " & newThread.NoMessages & vbNewLine &
  178.             '       "Locked: " & newThread.Locked & vbNewLine &
  179.             '       "PostIt: " & newThread.PostIt & vbNewLine &
  180.             '       "Poll: " & newThread.Poll & vbNewLine)
  181.         Next
  182.         Return lstOutput
  183.     End Function
  184.  
  185.     Public Function GetAtelierThreadList(ByVal strPage As String, Optional ByVal booIsInbox As Boolean = False) As List(Of ThreadTitleAndID)
  186.         Dim lstOutput As New List(Of ThreadTitleAndID)
  187.  
  188.         strPage = strPage.Replace(vbLf, "").Replace(vbCr, "")
  189.  
  190.  
  191.         'Dim matchThreads As MatchCollection = Regex.Matches(strPage, "<a class=""cadre-sujet-titre lien-blanc"".*?<div class=""span12"">", RegexOptions.Multiline And RegexOptions.IgnoreCase)
  192.         Dim matchThreads As MatchCollection = Regex.Matches(strPage, "<table class=""table-cadre table-cadre-centree"">.*?<\/table>", RegexOptions.Multiline Or RegexOptions.IgnoreCase)
  193.  
  194.  
  195.         For Each threadToCheck As Match In matchThreads
  196.             Dim matchTopic As String = ""
  197.  
  198.             If booIsInbox Then
  199.                 matchTopic = Regex.Match(threadToCheck.Value, "conversation.*?co=\d\d?\d?\d?\d?\d?\d?\d?\d?", RegexOptions.IgnoreCase).Value
  200.                 matchTopic = Regex.Match(matchTopic, "\d\d?\d?\d?\d?\d?\d?\d?\d?$", RegexOptions.IgnoreCase).Value
  201.             Else
  202.                 matchTopic = Regex.Match(threadToCheck.Value, "topic.*?t=\d\d?\d?\d?\d?\d?\d?\d?\d?", RegexOptions.IgnoreCase).Value
  203.                 matchTopic = Regex.Match(matchTopic, "\d\d?\d?\d?\d?\d?\d?\d?\d?$", RegexOptions.IgnoreCase).Value
  204.             End If
  205.  
  206.  
  207.  
  208.  
  209.  
  210.             Dim matchTitle As String = Regex.Match(threadToCheck.Value, "<a class=""cadre-sujet-titre lien-blanc" & ".*?" & "</a>", RegexOptions.IgnoreCase).Value
  211.             matchTitle = Regex.Replace(matchTitle, "<.*?>", "", RegexOptions.IgnoreCase).Trim
  212.  
  213.             Dim matchLink As String = "https://atelier801.com/" & Regex.Match(threadToCheck.Value, "href=""" & "(?<link>.*?)" & """", RegexOptions.IgnoreCase).Groups("link").Value.Trim
  214.  
  215.             Dim matchAuthors As MatchCollection = Regex.Matches(threadToCheck.Value, "alt=""""\>" & "(?<author>.*?)" & "\</span\>", RegexOptions.IgnoreCase)
  216.  
  217.             'Dim matchTimeCreated As String = Regex.Match(threadToCheck.Value, " le <span class=""date-ms hidden"" .*?>" & "(?<time>.*?)" & "</span>", RegexOptions.IgnoreCase).Groups("time").Value.Trim
  218.             Dim matchTimeCreated As String = Regex.Match(threadToCheck.Value, "<span class=""date-ms hidden"" .*?>" & "(?<time>.*?)" & "</span>", RegexOptions.IgnoreCase).Groups("time").Value.Trim
  219.  
  220.             Dim matchlastPost As Match = Regex.Match(threadToCheck.Value, "<span class=""date-ms hidden"" data-afficher-secondes=""false"">" & "(?<time>.*?)" & "</span>", RegexOptions.IgnoreCase)
  221.  
  222.             Dim matchNoMessages As Match = Regex.Match(threadToCheck.Value, "\<a class=""nombre-messages .*?\>(?<nomessages>.*?)\<\/a\>", RegexOptions.IgnoreCase)
  223.  
  224.  
  225.  
  226.             Dim newThread As New ThreadTitleAndID
  227.             newThread.ID = matchTopic
  228.             newThread.Title = HttpUtility.HtmlDecode(matchTitle)
  229.             newThread.RawPost = threadToCheck.Value
  230.             newThread.URL = matchLink
  231.  
  232.             'Remove link to post and page number
  233.             newThread.URL = Regex.Replace(newThread.URL, "#m\d\d?\d?\d?\d?\d?$", "", RegexOptions.IgnoreCase)
  234.             newThread.URL = Regex.Replace(newThread.URL, "&p=\d\d?\d?\d?\d?\d?$", "", RegexOptions.IgnoreCase)
  235.  
  236.             'Add max posts shown to 100
  237.             newThread.URL = newThread.URL & "&n=100"
  238.  
  239.             newThread.Author = matchAuthors(0).Groups("author").Value 'matchAuthors(1).Groups("author").Value
  240.             newThread.TimeCreated = ConvertMinutesTimestamp(matchTimeCreated)
  241.             newThread.LastReplyName = "" 'matchAuthors(0).Groups("author").Value
  242.             newThread.LastReplyTime = ConvertMinutesTimestamp(matchlastPost.Groups("time").Value.Trim)
  243.             newThread.NoMessages = CInt(matchNoMessages.Groups("nomessages").Value.Trim)
  244.  
  245.             If threadToCheck.Value.Contains("<img src=""/img/icones/cadenas.png""") Then
  246.                 newThread.Locked = True
  247.             Else
  248.                 newThread.Locked = False
  249.             End If
  250.  
  251.             If threadToCheck.Value.Contains("<img src=""/img/icones/postit.png""") Then
  252.                 newThread.PostIt = True
  253.             Else
  254.                 newThread.PostIt = False
  255.             End If
  256.  
  257.             lstOutput.Add(newThread)
  258.  
  259.             'WriteLogBalls(newThread.ID & " : " & newThread.Title & " : " & newThread.RawPost & " : " & newThread.URL & " : " & newThread.Author & " : " & newThread.TimeCreated & " : " & newThread.LastReplyName & " : " & newThread.LastReplyTime & " : " & newThread.NoMessages)
  260.         Next
  261.  
  262.  
  263.  
  264.  
  265.  
  266.         Return lstOutput
  267.     End Function
  268.  
  269.     Public Function ConvertMinutesTimestamp(ByVal timestamp As String) As DateTime
  270.  
  271.         Return New DateTime(1970, 1, 1, 0, 0, 0).AddMilliseconds(timestamp).AddHours(-4)
  272.  
  273.     End Function
  274.  
  275.     Public Function GetInboxMessagesSource(ByVal strPage As String) As List(Of NewForumPostData)
  276.         Dim lstOutput As New List(Of NewForumPostData)
  277.  
  278.         Dim matchPostsOnPage As MatchCollection = Regex.Matches(strPage, _
  279.         "<span class=""date-ms .*?>(?<timeofpost>.*?)<\/span>.*?profile\?pr=(?<username>.*?)"">.*?<div id=""citer_message.*?>(?<message>.*?)<\/div>.*?<a class=""numero-message"".*?>(?<postno>.*?)<\/a>", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
  280.  
  281.         For Each postMatch As Match In matchPostsOnPage
  282.             Dim currPost As New NewForumPostData
  283.             currPost.Username = StrConv(postMatch.Groups("username").Value.Trim, vbProperCase)
  284.             If Regex.IsMatch(currPost.Username, "%2B", RegexOptions.IgnoreCase) Then
  285.                 currPost.Username = Regex.Replace(currPost.Username, "%2B", "", RegexOptions.IgnoreCase)
  286.                 currPost.Username = "+" & StrConv(currPost.Username, vbProperCase)
  287.             End If
  288.             currPost.Message = HttpUtility.HtmlDecode(postMatch.Groups("message").Value.Trim)
  289.             currPost.Message = currPost.Message.Replace(vbLf, vbLf & Chr(9))
  290.             currPost.PostNo = postMatch.Groups("postno").Value.Trim.Replace("#", "")
  291.  
  292.             currPost.PostDate = postMatch.Groups("timeofpost").Value.Trim
  293.             lstOutput.Add(currPost)
  294.         Next
  295.  
  296.         Return lstOutput
  297.     End Function
  298.  
  299.     Public Function GetNewFormPostsSource(ByVal strPage As String) As List(Of NewForumPostData)
  300.         Dim lstNewForumPosts As New List(Of NewForumPostData)
  301.  
  302.         'Dim matchForumPost As MatchCollection = Regex.Matches(strPage, "<span class=""date-minutes hidden"">" & "(?<postdate>.+?)" & "</span>" & _
  303.         '".*?" & "href=""profile\?pr=" & "(?<user>.+?)" & """>" & _
  304.         '".*?" & "<a class=""numero-message""" & ".*?" & """>" & "(?<postno>.+?)" & "</a>" & _
  305.         '".*?" & "<div class=""cadre-message-message"">" & "(?<message>.+?)" & "</div>", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
  306.         Dim matchForumPost As MatchCollection = Regex.Matches(strPage, "<span class=""date-ms hidden"" data-afficher-secondes=""false"">" & "(?<postdate>.+?)" & "</span>" & _
  307. ".*?" & "href=""profile\?pr=" & "(?<user>.*?)" & """>" & _
  308. ".*?" & "<a class=""numero-message""" & ".*?" & """>" & "(?<postno>.*?)" & "</a>" & _
  309. ".*?" & "<div class=""cadre-message-message"">" & "(?<message>.*?)" & "</div>", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
  310.  
  311.         For Each postMatch As Match In matchForumPost
  312.             Dim currPost As New NewForumPostData
  313.             currPost.Username = StrConv(postMatch.Groups("user").Value.Trim, vbProperCase)
  314.             If Regex.IsMatch(currPost.Username, "%2B", RegexOptions.IgnoreCase) Then
  315.                 currPost.Username = Regex.Replace(currPost.Username, "%2B", "", RegexOptions.IgnoreCase)
  316.                 currPost.Username = "+" & StrConv(currPost.Username, vbProperCase)
  317.             End If
  318.  
  319.  
  320.             currPost.Message = postMatch.Groups("message").Value.Trim
  321.  
  322.             currPost.Message = Regex.Replace(currPost.Message, "<div id="".*?"">", "", RegexOptions.IgnoreCase)
  323.             currPost.Message = Regex.Replace(currPost.Message, "<div>", "", RegexOptions.IgnoreCase)
  324.             currPost.Message = Regex.Replace(currPost.Message, "<span class=""cadre-message-modere-texte"">", "", RegexOptions.IgnoreCase)
  325.             currPost.Message = Regex.Replace(currPost.Message, "</span>", "", RegexOptions.IgnoreCase)
  326.             currPost.Message = HttpUtility.HtmlDecode(currPost.Message)
  327.  
  328.             currPost.Message = Regex.Replace(currPost.Message, Regex.Escape("<span style=""font-family:Tahoma;""><span style=""font-size:10px;"">=^<span style=""color:#30BA76;"">?<span style=""font-size:10px;"">?<span style=""color:#30BA76;"">?^<span style=""font-size:10px;"">="), "", RegexOptions.IgnoreCase)
  329.             currPost.Message = Regex.Replace(currPost.Message, Regex.Escape("<span style=""font-family:Tahoma;""><span style=""font-size:10px;"">=^<span style=""color:#30BA76;"">●<span style=""font-size:10px;"">⋏<span style=""color:#30BA76;"">●^<span style=""font-size:10px;"">="), "", RegexOptions.IgnoreCase)
  330.             currPost.Message = Regex.Replace(currPost.Message, "<br ?/?>", " ", RegexOptions.IgnoreCase)
  331.  
  332.             Dim matchLinks As MatchCollection = Regex.Matches(currPost.Message, "<a href.*?</a>", RegexOptions.IgnoreCase)
  333.             For Each link As Match In matchLinks
  334.                 Dim matchCurrLink As Match = Regex.Match(link.Value, "<a href=""(?<url>.*?)"".*?>(?<text>.*?)</a>", RegexOptions.IgnoreCase)
  335.                 currPost.Message = Regex.Replace(currPost.Message, Regex.Escape(matchCurrLink.Value), matchCurrLink.Groups("text").Value & ": " & matchCurrLink.Groups("url").Value, RegexOptions.IgnoreCase)
  336.             Next
  337.  
  338.             currPost.PostNo = postMatch.Groups("postno").Value.Trim.Replace("#", "")
  339.             currPost.PostDate = postMatch.Groups("postdate").Value.Trim
  340.             lstNewForumPosts.Add(currPost)
  341.         Next
  342.  
  343.         Return lstNewForumPosts
  344.     End Function
  345.  
  346.     Sub WriteLogBalls(ByVal strLine As String)
  347.         Using swWriteLog As New System.IO.StreamWriter("C:\Users\inkan\Dropbox\new\Mewbzz\0_log.txt", True)
  348.             swWriteLog.WriteLine(strLine)
  349.         End Using
  350.     End Sub
  351.     Sub WriteLogBalls2(ByVal strLine As String)
  352.         Using swWriteLog As New System.IO.StreamWriter("C:\Users\inkan\Dropbox\new\Mewbzz\0000_log.txt", True)
  353.             swWriteLog.WriteLine(strLine)
  354.         End Using
  355.     End Sub
  356.  
  357.     Public Sub DeleteLogBalls()
  358.         If System.IO.File.Exists("C:\Users\inkan\Dropbox\new\Mewbzz\0_log.txt") Then
  359.             System.IO.File.Delete("C:\Users\inkan\Dropbox\new\Mewbzz\0_log.txt")
  360.         End If
  361.     End Sub
  362.  
  363. End Module
  364.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement