### PBin2TclH.tcl 1.3.0 ME5hHLZn #SUGGESTED # PBinSrc.tcl fMrtKqyq # TCLLoader.tcl smApj15u #LICENSE # Copyright © 2012 - 2013 Alberto Dietze "DoctorD90" # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Full GPLv3 Text: http://www.gnu.org/licenses/gpl.txt #PATERNITY #Coder: DoctorD90 #Network: irc.OnlineGamesNet.net #Chan: #eHito #Mail: DoctorD90@EggTcl.tk #Script's List: www.EggTcl.tk # #Thanks to guys on #egghelp on irc.freenode.net #Special thanks to Thommey #PURPOSE #Transfering text from pastebin.com to tclhelp.net. #USAGE #Write a pastebin.com url in chan, and bot will give back a Paste.tclhelp.net url #SETTINGS #Set flag of allowed people to use this script. set pb2tclh(pflag) "-" ### DON'T EDIT ANYTHING BELOW ### package require http bind pubm $pb2tclh(pflag) "*pastebin.com/*" pubm_pb2tclh proc pubm_pb2tclh {nick uhost hand chan text} { set ids [lsearch -all -nocase -inline [split $text] "*pastebin.com/*" ] if {![string length $ids]} {return} foreach pbinid [split $ids] { if {[regexp -nocase {(pastebin.com/[\d\w-]{8})} $pbinid link]} { set code [http::data [set Token [http::geturl "http://pastebin.com/raw.php?i=[lindex [split $link /] end]" -timeout "30000"]]] http::cleanup $Token set sid [socket tclhelp.net 55555] fconfigure $sid -buffering line puts $sid $code gets $sid gets $sid gets $sid url close $sid putserv "PRIVMSG $chan :http://$link => $url" } } } ### putlog "PBin2TclH.tcl LOADED"