Advertisement
TheShadow

mIRC URLTitle

Mar 31st, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. ;#################################################
  2. ;## ##
  3. ;## URLTitle 1.0 Regex ##
  4. ;## Made by TheShadow ##
  5. ;## ##
  6. ;#################################################
  7.  
  8. on *:TEXT:*http*:#hf-network,#hf-modders,#testtest2: {
  9. ;echo -d i'm in TEXT and my text was $1
  10. if (http isin $1) { URLTitleFun $1 }
  11. }
  12.  
  13. alias URLTitleFun {
  14. %FromChannel = $chan
  15. ;echo -a URLTitleFun
  16. ;echo -a send url : $1
  17.  
  18. if ($regex(info, $1, ([a-z][a-z0-9+\-.]*?:\/\/)([^\/?#]+)?(.*) )) {
  19. ;echo -a Groups Counter: $regml(info,0)
  20. %site = $regml(info, 2)
  21. %siteSub = $regml(info, 3)
  22.  
  23. ;echo -a site: %site
  24. ;echo -a siteSub: %siteSub
  25.  
  26. if (youtu isin $1) {
  27. /return
  28. }
  29. else (https isin $1) {
  30. sockclose URLTitle
  31. sockopen -e URLTitle %site 443
  32. }
  33. else {
  34. sockclose URLTitle
  35. sockopen URLTitle %site 80
  36. }
  37.  
  38. }
  39. }
  40.  
  41. on *:sockopen:URLTitle: {
  42. ;echo -a sockopen:URLTitle
  43. ;echo -a %site / www. $+ %site / %siteSub
  44.  
  45. /*
  46. echo -a $sockname GET %siteSub HTTP/1.1
  47. ;echo -a $sockname Host: www. $+ %site
  48. echo -a $sockname Host: %site
  49. echo -a $sockname Connection: close
  50. echo -a $sockname $crlf
  51. */
  52.  
  53. sockwrite -n $sockname GET %siteSub HTTP/1.1
  54. sockwrite -n $sockname Host: %site
  55. sockwrite -n $sockname Connection: close
  56. sockwrite -n $sockname $crlf
  57. }
  58.  
  59. on *:sockread:URLTitle: {
  60. ;echo -a sockread:URLTitle
  61. if ($sockerr) {
  62. /msg %FromChannel An error occurred: $sock($sockname).wsmsg
  63. }
  64.  
  65. sockread %line
  66. ;echo -a Line: %line
  67. if ($regex(info,%line, <title>(.*)<\/title>\s?\S? )) {
  68. sockclose $sockname
  69. ;echo -a Groups Counter: $regml(info,0)
  70. ;echo -a Groups Counter: $regml(info,1)
  71. %holdmsg = $regml(info,1)
  72. %holdmsg = $replace(%holdmsg,&#38;,')
  73. %holdmsg = $replace(%holdmsg,&#34;,')
  74. %holdmsg = $replace(%holdmsg,&#39;,')
  75. %holdmsg = $replace(%holdmsg,&quot;,')
  76. %holdmsg = $replace(%holdmsg,&amp;,&)
  77. %holdmsg = $replace(%holdmsg,&#x27;,')
  78.  
  79.  
  80. /msg %FromChannel 4[10Site Title4]5 %holdmsg
  81.  
  82. }
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement