need help for pagerank script

Решение вопросов при работе с TCL скриптами.

Модератор: Модераторы

need help for pagerank script

Сообщение heartbroken » 07 апр 2012 09:32

hi.

sorry i cant speak your language.but i already use your many scripts into my bots(like imdb,ls,allmusic.tcls)
so i like your Works on here and i've been trying to follow ..but now i am here for need to get some help from you..

i've been trying to make a pagerank script in last couple of days but i couldnt made it so i understood that to i need someone's help for to finish that b-cus i actualy dunno what i've trying to do with that.

this is my first time as you can see on code i am a newbie . i have try to make a get data from a web page script so i am trying to learn how ...i'd check some couple of scripts something similar and i had trying to made same on this but as you can see downstairs its not been working and i realy dunno how i can fix this.

i tried so many different ways for to get work this code but at last i understood that to i cant make it and i need help..
i will be thankful for all of your helps

best regards ..

here is that code''

TCL: [ Скачать ] [ Скрыть ]
package require http

bind pub - !pr pr
 proc pr {nick uhost hand chan text} {
   global botnick rank
 if {![string match -nocase "#bum" $chan]} { return }
   set site [lindex $text 0]
   if {$site == ""} {putquick "PRIVMSG $chan :Yanlış yada eksik komut girdiniz. !pr http://site.com şeklinde olmalı.";return}
    set connect [::http::geturl http://www.sitebilgi.net/]
    set files [::http::data $connect]
   regexp -- {</a></td><td class="sonuc"><span>...(.*?)</span></td>.*?} $files - googlePS
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - googleP
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - alexaG
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - alexaC
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - googleB
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - googleI
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - facebook
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - dmoz
    regexp -- {<td class="sonuc"><span>...(.*?)</span></td>.*?} $files - yahooB
    regexp -- {<td class="sonuc"><b><span>...(.*?)</span></b></td>.*?} $files - bingI
   ::http::cleanup $files
   
    putquick "PRIVMSG $chan Google pagerank\0033$googleP:  Alexa Dünya sırası\0033$alexaG:"
    putquick "PRIVMSG $chan Alexa ülke sırası\0033$alexaC:  Google backlink\0033$googleB:"
    putquick "PRIVMSG $chan Google indeksi\0033$googleI:  Facebook'ta paylaşım\0033$facebook:"
    putquick "PRIVMSG $chan DMOZ kaydı\0033$dmoz:  Yahoo indeks\0033$yahooB:"
    putquick "PRIVMSG $chan Sayfa Hızı Skoru\0033$googlePS: Bing indeks sayısı\0033$bingI:"
}
Life iS Just a dReaM oN tHE wAy to DeaTh
Аватара пользователя
heartbroken
 
Сообщения: 18
Зарегистрирован: 07 апр 2012 09:25
Благодарил (а): 9 раз.
Поблагодарили: 0 раз.

Re: need help for pagerank script

Сообщение tvrsh » 07 апр 2012 11:30

Your website gives results in javascript, I dont now how to parse it.
I found another site with more "script friendly" code:
TCL: [ Скачать ] [ Скрыть ]
package require http

bind pub - !pr pr
proc pr {nick uhost hand chan text} {
    global botnick rank
    if {![string match -nocase "#bum" $chan]} { return }
    set site [lindex $text 0]
    if {$site == ""} {
        putquick "PRIVMSG $chan :Yanlış yada eksik komut girdiniz. !pr http://site.com şeklinde olmalı."
        return
    }

    # Set the url with your site
    set connect [::http::geturl http://www.seoheap.com/websitevalue/$site]
    set files [::http::data $connect]

    # delete all newline codes, now $files contain only one line with all data
    regsub -all -- {\n|\t} $files "" files

    # parse some information from $files
    regexp -- {<h2>Website Value</h2>.*?<b>(.*?)</b>} $files - wsvalue
    regexp -- {<h3>Page Rank</h3>.*?<b>(.*?)</b>} $files - googlePR
    regexp -- {Google Results</a>.*?<td>(.*?)</td>} $files - googleR
    regexp -- {Bing Results</a>.*?<td>(.*?)</td>} $files - bingR
    regexp -- {Outgoing Links</a>.*?<td>(.*?)</td>} $files - OGlinks
    regexp -- {Yahoo Backlinks</a>.*?<td>(.*?)</td>} $files - yahooBL
    regexp -- {Alexa</a>.*?<td>(.*?)</td>} $files - alexa
    regexp -- {Alexa Backlinks</a>.*?<td>(.*?)</td>} $files - alexaBL
    regexp -- {DMoz Listing</h3>.*?<a .*?>(.*?)</a>} $files - dmozL
    regexp -- {Age</h3>.*?<a .*?>(.*?)</a>} $files - age
    regexp -- {IP Address</h3>.*?<a .*?>(.*?)</a>} $files - ip
    ::http::cleanup $files
   
    putquick "PRIVMSG $chan :\00314Website Value: \00303$wsvalue"
    putquick "PRIVMSG $chan :\00314Page Rank: \00303$googlePR"
    putquick "PRIVMSG $chan :\00314Google Results: \00303$googleR"
    putquick "PRIVMSG $chan :\00314Bing Results: \00303$bingR"
    putquick "PRIVMSG $chan :\00314Outgoing Links: \00303$OGlinks"
    putquick "PRIVMSG $chan :\00314Yahoo Backlinks: \00303$yahooBL"
    putquick "PRIVMSG $chan :\00314Alexa: \00303$alexa"
    putquick "PRIVMSG $chan :\00314Alexa Backlinks: \00303$alexaBL"
    putquick "PRIVMSG $chan :\00314DMoz Listing: \00303$dmozL"
    putquick "PRIVMSG $chan :\00314Age: \00303$age"
    putquick "PRIVMSG $chan :\00314IP Address: \00303$ip"

}
Have fun.
-
Получить помощь можно на каналах #egghelp в сети IrcNet.ru и #eggdrop в сети RusNet(Ключ канала eggdrop).
Перед созданием новой темы внимательно читайте Правила оформления топиков.
Аватара пользователя
tvrsh
 
Сообщения: 1230
Зарегистрирован: 19 авг 2008 16:55
Откуда: Russian Federation, Podolsk
Благодарил (а): 6 раз.
Поблагодарили: 130 раз.
Версия бота: Eggdrop 1.6.20+suzi

Re: need help for pagerank script

Сообщение heartbroken » 07 апр 2012 11:53

ah thank you very much.i never thought that way :)
i appreciated thanks for your quick responce ..

my best ragards
Life iS Just a dReaM oN tHE wAy to DeaTh
Аватара пользователя
heartbroken
 
Сообщения: 18
Зарегистрирован: 07 апр 2012 09:25
Благодарил (а): 9 раз.
Поблагодарили: 0 раз.


Вернуться в TCL скрипты

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 9

cron