Taek Voice
Joined: 22 Jan 2010 Posts: 1
|
Posted: Fri Jan 22, 2010 12:29 am Post subject: URL Shortening Service |
|
|
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.example.com/some-path/to-dir/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: |
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. |
|