egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

url shortener

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Sat Jul 30, 2022 7:58 pm    Post subject: url shortener Reply with quote

Hi there
I had been running a script to use v.gd and is.gd for delivering shortened urls of news stories to a channel...but lately has been returning nothing despite the sites appearing to still be working.
Was wondering if anyone has had experience using these sites in scripts? Currently the only other shortener site I've been able to use sucessfully is tinyurl but would prefer the reduced length of the first 2 mentioned.

Thanks in advance for any help!
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Sun Jul 31, 2022 8:12 am    Post subject: Reply with quote

Can you provide your scripts so we can test and look for an explanation and/or a solution
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Sun Aug 28, 2022 12:27 am    Post subject: Reply with quote

Thanks & apologies for the spectacularly slow reply:

Code:
set query [::http::geturl http://v.gd/create.php?url=$somelongurltoshorten&format=simple]
set url [lindex [split [::http::data $query] \n] 0]
putserv "PRIVMSG $channel :$url"


Thanks again!
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Mon Aug 29, 2022 10:09 am    Post subject: Reply with quote

v.gd now uses https, so you need the tls package and modify the script like this:
Code:
::http::register https 443 [list ::tls::socket -autoservername true]
set query [::http::geturl https://v.gd/create.php?url=$somelongurltoshorten&format=simple]
set url [lindex [split [::http::data $query] \n] 0]
::http::cleanup $query
::http::unregister https
putserv "PRIVMSG $channel :$url"

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Mon Aug 29, 2022 5:23 pm    Post subject: Reply with quote

Thanks for this - looks like perhaps my shell provider dosn't have the needed items as it's still returning an empty url...
Thanks anyway.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Mon Aug 29, 2022 6:34 pm    Post subject: Reply with quote

did you add package require tls after the package require http line in your script ?
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Mon Aug 29, 2022 7:12 pm    Post subject: Reply with quote

added to top of script:

package require http
package require tls

but bot quit with this error when rehashed:

Tcl error in file 'i.conf':
can't find package tls
while executing
"package require tls"
Back to top
View user's profile Send private message Visit poster's website
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Mon Aug 29, 2022 8:35 pm    Post subject: Reply with quote

ps not sure if it helps but the script I use for tinyurl is:


Code:

set query [::http::geturl http://tinyurl.com/api-create.php?url=$someurl]
   set url [lindex [split [::http::data $query] \n] 0]


...and it seems to work without the https even though tinyurl is also an https site?
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Tue Aug 30, 2022 4:23 am    Post subject: Reply with quote

Ok, so you upgrade your tcl version, or ask your hoster to upgrade it, as tls is in tcl since version 8.4.

And tinyurl allows the non-https queries when v.gd forces the https usage (tested and verified)
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 64

PostPosted: Tue Aug 30, 2022 5:16 pm    Post subject: Reply with quote

Thanks...will send them a message.
Appreciate the help!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber