Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. sPostsFileName = "Z:\posts.txt" 'copy the webpage source of dreadecomdopooda.onion/post/1a97b513a13bf47e/ and paste into posts.txt file
  2. sExcelFile = "Z:\results.xlsx" 'output excel file, change path and files names if you want
  3. '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
  4. Const ForReading = 1
  5. Set objFSO = CreateObject("Scripting.FileSystemObject")
  6. Set objOpen = objFSO.OpenTextFile(sPostsFileName, ForReading)
  7. Set objExcel = CreateObject("Excel.Application")
  8. objExcel.Application.Visible = False
  9. Set objWorkbook = objExcel.Workbooks.Add()
  10. Dim arrFileName()
  11. iGetDateTime = 0
  12. i = 0
  13. Do While objOpen.AtEndOfStream <> true
  14. text = objOpen.ReadLine
  15. If iGetDateTime = 1 Then
  16. sGetDateTimePost = Left(text, 61)
  17. sGetDateTimePost2 = Right(sGetDateTimePost, 19)
  18. If Left(sGetDateTimePost2, 5) = "title" Then
  19. sGetDateTimePost = Left(text, 68)
  20. sGetDateTimePost2 = Right(sGetDateTimePost, 19)
  21. Else
  22. End If
  23. iCounter2 = iCounter2 + 1
  24. objExcel.Cells(iCounter2 - 1, 2).Value = sGetDateTimePost2
  25. iCounter2 = iCounter2 - 1
  26. Else
  27. End If
  28. iGetDateTime = 0
  29. sCheckUserName = Replace(text, Chr(9), "")
  30. sCheckUserName2 = Replace(sCheckUserName, Chr(34), "")
  31. If left(sCheckUserName2, 20) = "<div class=userName>" Then
  32. sCheckUserName3 = Replace(sCheckUserName2, "<div class=userName><a href=/u/", "")
  33. sEnd = ""
  34. iCounter = 0
  35. Do Until sEnd = " "
  36. iCounter = iCounter + 1
  37. sCheckUserName4 = Left(sCheckUserName3, iCounter)
  38. sEnd = Right(sCheckUserName4, 1)
  39. Loop
  40. sUserName = Left(sCheckUserName4, iCounter - 1)
  41. iGetDateTime = 1
  42. iCounter2 = iCounter2 + 1
  43. objExcel.Cells(iCounter2, 1).Value = sUserName
  44. Else
  45. End If
  46. ReDim Preserve arrFileName(i)
  47. arrFileName(i) = text
  48. i=i+1
  49. loop
  50. objExcel.Rows(1).Delete
  51. objOpen.Close
  52. objWorkbook.SaveAs sExcelFile
  53. objWorkbook.Close
  54. objExcel.Application.Quit
  55. Set objOpen = Nothing
  56. Set objFSO = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement