This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

URL Shortening Service

Help for those learning Tcl or writing their own scripts.
Post Reply
T
Taek
Voice
Posts: 1
Joined: Fri Jan 22, 2010 12:21 am

URL Shortening Service

Post by Taek »

Hi folks, i am completely new to TCL. I am trying to create a URL Shortening script for my eggdrop bot, but i don't understand how i can get the information from a website that returns just plain text.

Example: http://url.srv/api.php?url=http://www.e ... /file.html

the return is just a simple url with no html formatting

http://url.srv/ABC123

how can get this this shortened url into a chat?

=================
I was thinking of maybe using the following but looking at the person's website and the way it returns the value doesn't add up to me.

Excerpt from another post by SL0RD

Code: Select all

bind pub - !miut miut:trim

proc miut:trim { nick host hand chan text } {
        set url $text
        if {[catch {exec /usr/bin/curl -d url=$url http://miut.me/create.php?} result]} {
                puthelp "PRIVMSG $chan :Error!"
        } else {
                puthelp "PRIVMSG $chan :It worked!"
        } 

Thanks in advance.
Post Reply