Quiz Memorial Forum

Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> poisk.tcl v3.6.5, Search engines parser
Kreon
post Sep 1 2008, 02:56 PM
Post #21


Developer
******

Group: Root Admin
Posts: 396
Joined: --
From: Внешние пределы
Member No.: 2



Всё нормально на патченных ботах с encoding system = cp1251.
По поводу других информации нет. Если кто исправит скрипт для совместимости с другими вариантами настройки бота не сломав работу на патченных - присылайте, выложу.


--------------------
Не понял сам - не дай понять другому
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Alvor
post Sep 2 2008, 04:32 PM
Post #22


Участник
***

Group: Members
Posts: 30
Joined: 9-March 07
Member No.: 76



Информация - на патченом работает, на непатченом яндекс кракозявит.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Xam
post Sep 13 2008, 01:18 PM
Post #23


Посетитель
*

Group: Members
Posts: 1
Joined: 13-September 08
Member No.: 248



На непатченном с
encoding system iso8859-1
set egg_codepage cp1251

CODE
proc ::poisk::yandex_on_data {id html nick chan uhost com} {
    global poisk
    if {![info exists sp_version]} {
        set html [encoding convertto cp1251 [encoding convertfrom utf-8 $html]]
    } else {
        set html [encoding convertfrom utf-8 $html]
    }
    regsub -all -- \n $html {} html; regsub -all -nocase -- </a> $html </a>\n html
    set qnum $poisk(host,$uhost); set num 0
    catch { unset poisk(host,$uhost) }
    if { $poisk(debug) } { putlog "\[poisk\] callback executed... analyzing data..." }
    set res "";    set total ""; set desc ""
    foreach line [split $html \n] {
       regexp -nocase -- {Нашлось<br>(.*?)страниц} $line garb total
        if { [regexp -nocase -- {<a tabindex.*?onclick.*?href=\"(.*?)\".*?target=.*?><b>(.*?)</b>.*?</a>} $line garb res desc] ||
             [regexp -nocase -- {<a tabindex=.*?onclick=.*?href=\"(.*?)\".*?target=.*?>(.*?)</a>} $line garb res desc] } { incr num; if { $num != $qnum } { set res ""; set desc "" } else { break } }
        }
    if { $poisk(debug) } { putlog "\[poisk\] res=$res desc=$desc total=$total" }
    if { $res == "" } { ::egglib::out $nick $chan $poisk(txt,fail_$com); return }
    set desc [string trim [::egglib::unhtml $desc]]
    set total [string trim [::egglib::unhtml [string map {  { }} $total]]]
    if { $total != "" } { set total " ($poisk(txt,total) $total)" }
    if { $desc != "" } { set desc " - \0035$desc\003" }
    ::egglib::out $nick $chan "\00312$res\003$desc$total"
}

Яндекс так работает в нормальной кодировке, поидее и на сузи так должно работать тоже. Рамблер и гугл работают без каких-либо правок.


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Alvor
post Oct 9 2010, 10:20 AM
Post #24


Участник
***

Group: Members
Posts: 30
Joined: 9-March 07
Member No.: 76



Оно опять не работает. Пачините? ))
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

2 Pages V < 1 2
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 18th April 2024 - 09:36 AM
Design by GPF © 2006