Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sPostsFileName = "Z:\posts.txt" 'copy the webpage source of dreadecomdopooda.onion/post/1a97b513a13bf47e/ and paste into posts.txt file
- sExcelFile = "Z:\results.xlsx" 'output excel file, change path and files names if you want
- 'After running the script, Open excel file, format cells on colunm B to custom m/d/yyyy h:mm:ss, sort B column oldest to newest
- Const ForReading = 1
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objOpen = objFSO.OpenTextFile(sPostsFileName, ForReading)
- Set objExcel = CreateObject("Excel.Application")
- objExcel.Application.Visible = False
- Set objWorkbook = objExcel.Workbooks.Add()
- Dim arrFileName()
- iGetDateTime = 0
- i = 0
- Do While objOpen.AtEndOfStream <> true
- text = objOpen.ReadLine
- If iGetDateTime = 1 Then
- sGetDateTimePost = Left(text, 61)
- sGetDateTimePost2 = Right(sGetDateTimePost, 19)
- If Left(sGetDateTimePost2, 5) = "title" Then
- sGetDateTimePost = Left(text, 68)
- sGetDateTimePost2 = Right(sGetDateTimePost, 19)
- Else
- End If
- iCounter2 = iCounter2 + 1
- objExcel.Cells(iCounter2 - 1, 2).Value = sGetDateTimePost2
- iCounter2 = iCounter2 - 1
- Else
- End If
- iGetDateTime = 0
- sCheckUserName = Replace(text, Chr(9), "")
- sCheckUserName2 = Replace(sCheckUserName, Chr(34), "")
- If left(sCheckUserName2, 20) = "<div class=userName>" Then
- sCheckUserName3 = Replace(sCheckUserName2, "<div class=userName><a href=/u/", "")
- sEnd = ""
- iCounter = 0
- Do Until sEnd = " "
- iCounter = iCounter + 1
- sCheckUserName4 = Left(sCheckUserName3, iCounter)
- sEnd = Right(sCheckUserName4, 1)
- Loop
- sUserName = Left(sCheckUserName4, iCounter - 1)
- iGetDateTime = 1
- iCounter2 = iCounter2 + 1
- objExcel.Cells(iCounter2, 1).Value = sUserName
- Else
- End If
- ReDim Preserve arrFileName(i)
- arrFileName(i) = text
- i=i+1
- loop
- objExcel.Rows(1).Delete
- objOpen.Close
- objWorkbook.SaveAs sExcelFile
- objWorkbook.Close
- objExcel.Application.Quit
- Set objOpen = Nothing
- Set objFSO = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement