teegg Voice
Joined: 04 Apr 2012 Posts: 7
|
Posted: Fri Apr 13, 2012 2:55 pm Post subject: rss synd tinyurl code optimization |
|
|
I am running rss synd 5b1 with tinyurl mod and am getting constant ping timeouts.
Originally I didn't think it was script related so i made the following post.
http://forum.egghelp.org/viewtopic.php?t=18920
but now I noticed the following:
[14:44] (!) timer drift -- spun 3 minutes
I think its due to the tinyurl code I added. Because before that, rss synd worked just fine and i had no ping timeouts. Also, some of the time, the tinyurl does show up when the rss is announced. SO i have two issues, my eggdrop tiems out and sometimes the tiny url does not produce anything.
Here is the tinyurl code I have:
| Code: | #tinyurl expansion for rss-synd.tcl
#@see http://forum.egghelp.org/viewtopic.php?p=66327#66327
proc ::rss-synd::tinyurl {url} {
#tinyurls are currently 26 chars at most
if {[string length $url] <= 26} { return $url; }
set tinyurl "http://tinyurl.com/api-create.php";
set query [::http::formatQuery "url" $url];
# since this connection is synchronous and blocks
# the timeout should be relatively small.
set token [::http::geturl "$tinyurl?$query" -timeout 5000];
set url [::http::data $token];
::http::cleanup $token;
return $url;
}
|
So obviously there is a timeout I can edit. But my question is, do I need to increase or decrease the timeout. And also, why is this a problem, is the tinyurl.com service slow? Should I use a different one? |
|