@holycrap:
Be warned of a few things before modifying anything:
- This trick may not be clean but it is a trick, it had been made in 5mn and has not been intended to be made public.
- My modification uses an old version of TkTiny by Tomekk (v0.4 I think). Latest version is 0.5.
- It has only been tested on RSS Syndication v0.4 but you can probably adapt it to v0.5b1 without too much pain.
- I give it to you "as is" and I'm not providing support for it.
- It works for me.
If you agree with the preceding terms, let's go.
You must first add this proc in the script:
Code: Select all
proc grab_data { url } {
set get_url_timeout "10"
set uagent "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3"
set url [string map -nocase {
"&" "&"
} $url]
set tiny_query "http://tinyurl.com/create.php?url=${url}"
set tiny_token [http::config -useragent $uagent]
set tiny_token [http::geturl $tiny_query -timeout [expr $get_url_timeout * 1000]]
set html_data [http::data $tiny_token]
set all_n [split $html_data \n]
set tiny_link ""
foreach tiny_lines $all_n {
if {[regexp -all -nocase "name\=tinyurl" $tiny_lines]} {
regsub -all -nocase "<input type=hidden name=tinyurl value=\"" $tiny_lines "" tiny_link
regsub -all -nocase "\">" $tiny_link "" tiny_link
}
}
if {$tiny_link != "0" && $tiny_link != ""} {
return $tiny_link
} {
return "\00307(there's a problem with tinyurl.com)\003 \00314${url}\003"
}
}
then find the line:
Code: Select all
set tmp [[namespace current]::xml_list_flatten $tmp]
and add just after it:
Code: Select all
if {([info exists feed(charset)]) && (([string last "title" $cookie] == 25) || ([string last "title" $cookie] == 19))} { set tmp [encoding convertfrom $feed(charset) [encoding convertfrom $feed(charset) $tmp]] }
if {([string last "link" $cookie] == 25) || ([string last "link" $cookie] == 19)} { set tmp [grab_data [lindex $tmp]] }