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.

rss synd tinyurl code optimization

Support & discussion of released scripts, and announcements of new releases.
Post Reply
t
teegg
Voice
Posts: 7
Joined: Wed Apr 04, 2012 11:37 am

rss synd tinyurl code optimization

Post by teegg »

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: Select all

#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?
Post Reply