Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set IE = CreateObject("internetexplorer.application")
  2. Set objFSO = CreateObject("Scripting.FileSystemObject")
  3.  
  4. on error resume next
  5.  
  6. 'Get Pewds subs
  7. IE.Visible = false
  8. IE.Navigate "https://www.youtube.com/user/PewDiePie"
  9. Do While IE.Busy or IE.ReadyState <> 4: WScript.sleep 100: Loop
  10. Do Until IE.Document.ReadyState = "complete": WScript.sleep 100: Loop
  11.  
  12. for each cnt in ie.document.getelementsbytagname("span")
  13.     if instr(cnt.getAttribute("aria-label"),"subscribers") then
  14.         pewds_subs = replace(cnt.innertext,",","")
  15.     end if
  16. next
  17.  
  18. 'Get TSeries subs
  19. IE.Navigate "https://www.youtube.com/user/tseries"
  20. Do While IE.Busy or IE.ReadyState <> 4: WScript.sleep 100: Loop
  21. Do Until IE.Document.ReadyState = "complete": WScript.sleep 100: Loop
  22.  
  23. for each cnt in ie.document.getelementsbytagname("span")
  24.     if instr(cnt.getAttribute("aria-label"),"subscribers") then
  25.         tseries_subs = replace(cnt.innertext,",","")
  26.     end if
  27. next
  28.  
  29. ie.quit
  30.  
  31. if pewds_subs > tseries_subs then
  32.     winner = "Current Leader: " & vbtab & "PewDiePie!!!"
  33. else
  34.     winner = "Current Leader: " & vbtab & "T-Series!!!"
  35. end if
  36.  
  37. wscript.echo "Pewds Subs: " & vbtab & pewds_subs & vbcrlf & _
  38.          "T-Series Subs: " & vbtab & tseries_subs & vbcrlf & vbcrlf & _
  39.         "Difference of: " & vbtab & abs(pewds_subs-tseries_subs) & vbcrlf & vbcrlf & winner
  40.        
  41. wscript.quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement