Advertisement
Xzempt

Untitled

Jun 13th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. on *:TEXT:*:#opers,#Calmdown,#blaze.u,#friendly: {
  2. if ($regex($1-,/(www\.youtube\.com/watch.+)/)) {
  3. %data = $regml(1)
  4. var %x = 0
  5. while (%x <= $nick($chan,0)) {
  6. if ($regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
  7. var %is.jas.here = true
  8. inc %x
  9. }
  10. if (!$regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
  11. inc %x
  12. }
  13. if (%x == $nick($chan,0)) && (%is.jas.here != true) {
  14. youtube
  15. %youtube.chan = $chan
  16. }
  17. }
  18. }
  19. }
  20. on *:INPUT:#opers,#Calmdown,#blaze.u,#friendly: {
  21. if ($regex($1-,/(www\.youtube\.com/watch.+)/)) {
  22. %data = $regml(1)
  23. var %x = 0
  24. while (%x <= $nick($chan,0)) {
  25. if ($regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
  26. var %is.jas.here = true
  27. inc %x
  28. }
  29. if (!$regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
  30. inc %x
  31. }
  32. if (%x == $nick($chan,0)) && (%is.jas.here != true) {
  33. youtube
  34. %youtube.chan = $chan
  35. }
  36. }
  37. }
  38. }
  39. alias youtube {
  40. %s = sockwrite -tn
  41. sockopen youtube www.youtube.com 80
  42. }
  43.  
  44. on *:SOCKOPEN:youtube: {
  45. %s $sockname GET /watch? $+ $gettok($gettok(%data,2,63),1,32) HTTP/1.1
  46. %s $sockname Host: www.youtube.com $+ $str($crlf,2)
  47. }
  48.  
  49. on *:SOCKREAD:youtube: {
  50. var %youtube | sockread %youtube
  51. if ($sockerr > 0) { echo -a Socket Error. }
  52. if (%youtube) {
  53. if ($regex(%youtube, /(<meta itemprop="name" content=".+">)/)) && (%is.jas.here != true) {
  54. %youtube.title = $regml(1)
  55. msg %youtube.chan 01,00You00,04Tube $trash($gettok(%youtube.title,3,61))
  56. }
  57. if ($regex(%youtube, /(</html>)/)) {
  58. sockclose $sockname
  59. }
  60. }
  61. }
  62. alias -l trash {
  63. var %x, %i = $regsub($1-,/(^"$)/g,$null,%x), %x = $remove(%x,&nbsp;,&#039;,&#39;,>,<,")
  64. return %x
  65. }
  66. alias -l nohtml {
  67. var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;,&#039;,&#39;)
  68. return %x
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement