egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

blu-ray.com script by dalys (current: blu-ray.com_1.2.tcl)
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Tue Oct 28, 2008 7:27 am    Post subject: Reply with quote

Great Script Smile My Users love to use it, but

i think a line seperator would be useful Smile

And one question:

Is it difficult to "change" the search, that if u use for eg

!bluray The.Dark.Knight also results are coming ?

greets
Back to top
View user's profile Send private message
dalys
Voice


Joined: 05 Oct 2008
Posts: 9
Location: Gothenburg, Sweden / QuakeNet

PostPosted: Tue Oct 28, 2008 10:19 am    Post subject: Reply with quote

Elfriede wrote:
Great Script Smile My Users love to use it, but

i think a line seperator would be useful Smile

And one question:

Is it difficult to "change" the search, that if u use for eg

!bluray The.Dark.Knight also results are coming ?

greets


Hello! Glad to hear users like it. Very Happy

What do you mean with line separator? Like a %breakline variable to use in the output style that will split the output in two messages? That should be doable I think! Will have to look in to it for the next version. Smile

About making a search with dots as separators, like "The.Dark.Knight", work you can fix it easily!

On line 103 in v1.1 of the script you find this line:
Code:
        set bluray_keywords [string map { " " "+" "%" "+" "&" "+" "*" "+"} $bluray_keywords]


And all you have to do is add "." "+" in the end of the inside of the braces, so the line will look like this instead:
Code:
        set bluray_keywords [string map { " " "+" "%" "+" "&" "+" "*" "+" "." "+"} $bluray_keywords]



(This will transform the search "The.Dark.Knight" into "The+Dark+Knight", and the blu-ray.com search function interprets plus signs, +, as spaces.)

Good luck. Razz
Back to top
View user's profile Send private message MSN Messenger
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Tue Oct 28, 2008 11:22 am    Post subject: Reply with quote

Thank you ! I'll try this ASAP Smile

With line seperator i mean to split the output-lines

Details for The Dark Knight (+ Digital Copy and BD Live) (Blu-ray)

Video: Video codec: VC-1/Video resolution: 1080p/Aspect ratio: 2.40:1

Audio: English: Dolby TrueHD 5.1/English: Dolby Digital 5.1/English: Dolby Digital 2.0/French: Dolby Digital 5.1 Subs: English SDH, English, French,

Spanish Disc: 50GB Blu-ray Disc/Three-disc set/Digital copy
Back to top
View user's profile Send private message
MiNdErAsR
Voice


Joined: 27 Nov 2004
Posts: 17

PostPosted: Sun Nov 02, 2008 9:24 am    Post subject: Reply with quote

Working like a charm. Thanks!

Cool
Back to top
View user's profile Send private message
jjnerd
Voice


Joined: 24 Feb 2007
Posts: 3

PostPosted: Sat Jan 23, 2010 9:47 am    Post subject: Reply with quote

"Could not fetch any search result or error message. The script is probably outdated."

Looks like smth has changed. Fix would be awesome, love the script.
Back to top
View user's profile Send private message
dalys
Voice


Joined: 05 Oct 2008
Posts: 9
Location: Gothenburg, Sweden / QuakeNet

PostPosted: Mon Feb 01, 2010 5:26 pm    Post subject: Reply with quote

Hello all! I have updated the script now and everything should work fine again. I was working on a 1.2 version in 2009 with some simple new features but I can not access that file now. Embarassed

Direct download for 1.2: http://github.com/dalys/Blu-ray.com-eggdrop-script/raw/master/blu-ray.com_1.2.tcl
Back to top
View user's profile Send private message MSN Messenger
Ragman
Voice


Joined: 06 Jun 2010
Posts: 5

PostPosted: Sun Jun 06, 2010 4:58 pm    Post subject: Reply with quote

I updated to version 1.2 of the script but I still get the error message "Could not fetch any search result or error message. The script is probably outdated.".
Have they updated their site again?
Back to top
View user's profile Send private message
cbsjanten1
Voice


Joined: 18 Jun 2010
Posts: 4

PostPosted: Fri Jun 18, 2010 11:05 am    Post subject: Reply with quote

hey im still running version 1.1
just replace ur url line with
Code:
set bluray_url "http://www.blu-ray.com/search/?quicksearch=1&section=movies&quicksearch_keyword=$bluray_keywords&searchbutton.x=0&searchbutton.y=0"


works really fine...great script
Back to top
View user's profile Send private message
Ragman
Voice


Joined: 06 Jun 2010
Posts: 5

PostPosted: Fri Jun 18, 2010 1:44 pm    Post subject: Reply with quote

cbsjanten1 wrote:
hey im still running version 1.1
just replace ur url line with
Code:
set bluray_url "http://www.blu-ray.com/search/?quicksearch=1&section=movies&quicksearch_keyword=$bluray_keywords&searchbutton.x=0&searchbutton.y=0"


works really fine...great script

I updated v1.2 with the above line and now it works like a charm.
THANKS A LOT! Smile
Back to top
View user's profile Send private message
cbsjanten1
Voice


Joined: 18 Jun 2010
Posts: 4

PostPosted: Sun Jul 04, 2010 7:43 am    Post subject: Reply with quote

seems the changed something on blu-ray.com again Sad
Back to top
View user's profile Send private message
Ragman
Voice


Joined: 06 Jun 2010
Posts: 5

PostPosted: Fri Sep 03, 2010 11:44 am    Post subject: Reply with quote

Anyone manage to fix the script again?
Back to top
View user's profile Send private message
dalys
Voice


Joined: 05 Oct 2008
Posts: 9
Location: Gothenburg, Sweden / QuakeNet

PostPosted: Fri Sep 03, 2010 11:46 am    Post subject: Reply with quote

Ragman wrote:
Anyone manage to fix the script again?


Hey-o! I'm actually working on it right now. Expect a new version today or at least this weekend. Smile
Back to top
View user's profile Send private message MSN Messenger
Ragman
Voice


Joined: 06 Jun 2010
Posts: 5

PostPosted: Fri Sep 03, 2010 11:47 am    Post subject: Reply with quote

Hooray!
Tack i förväg Wink
Back to top
View user's profile Send private message
Znuff
Voice


Joined: 17 May 2010
Posts: 9

PostPosted: Tue Sep 07, 2010 11:01 am    Post subject: Reply with quote

impatiently waiting

(would be nice to see the .diff)
Back to top
View user's profile Send private message
Znuff
Voice


Joined: 17 May 2010
Posts: 9

PostPosted: Thu Sep 23, 2010 3:13 pm    Post subject: Reply with quote

Couldn't wait for an update from dalys so I updated it to suit my needs. I removed the -details switch because there was way too much work to adapt it for the changes on blu-ray.com.

Code:


######################################################################################
# Blu-ray.com script made by dalys that search the website                           #
# http://www.blu-ray.com for movie titles and fetch info                             #
######################################################################################
#
# Bugs/Suggestions/Whatever contact: dalys@chokladboll.se
#
# <dalys> !bluray the dark knight
# <bot> "The Dark Knight (Blu-ray)" Release date: Dec 09, 2008 (Year: 2008  Length: 152 mins Rating: Rated PG-13 Studio: Warner Bros.)
#
# Requirements: http.tcl, uri.tcl
#
# Tested on eggdrop 1.6.18 & 1.6.19 & 1.6.20
#
# 1.3coconut 2010-09-23 / znuffy@gmail.com
# - Removed the -details option, too much work to maintain it between the layout changes
#   of blu-ray.com
# - Fixed and added new stuff for the layout/code changes of blu-ray.com.
# - Lowered default timeout value to 10seconds
#
# 1.2 2010-02-01
# - Blu-ray.com has been updated (with a better search function it seems)
#   and so has the script.
# - Moved the project to github.
#
# 1.1 2008-10-26
# - Fixed a broken regexp due to changes in blu-ray.com's html code
# - Replaced the replacevar function with regsub (replacevar was not part of standard TCL)
#   Thanks to speechles for taking his time and helping out with the above!
#
# 1.0 2008-10-05
# First release.
#
#
# Known issues:
# - Found one title with the release date set to "2009", which the script will mistake
# for the year the movie was made which is also just four digits.
#


#### CONFIG ####


# Channels were script can be used (the only config line you HAVE to change)
set bluray_availchans "#test1"

# Channels were the result will be sent in PM
set bluray_quitechans "#chan2 #chan4"

# Output style
#
# IRC markup: bold = \002, underline = \037, reverse(italic in some clients) =  \026
# Example: %title is coming out \002%releasedate\002!
#
# Normal search (!bluray <title>)
# Variables available: %title %studio %year %releasedate %rating %length
# Default: "\"%title\" Release date: \002%releasedate\002 \(Year: %year Length: %length Rating: %rating Studio: %studio\)"
set bluray_outputstyle "\"%title\" Release date: \002%releasedate\002 \(Year: %year Length: %length Rating: %rating Studio: %studio\)"

# Timeout, in ms (default: "20000")
set bluray_timeout "10000"

# What commands to respond to (default: !bluray !bd !br)

bind pub - !bluray bluray_pub
bind pub - !blu-ray bluray_pub
bind pub - !bd bluray_pub
bind pub - !br bluray_pub


#### END OF CONFIG ####


#### DO NOT EDIT BELOW, UNLESS YOU ACTUALLY KNOW WHAT YOU ARE DOING ####

set bluray_version "1.3coconut"
package require http
package require uri

proc geturl_followRedirects {url args} {
    array set URI [::uri::split $url] ;# Need host info from here
    foreach x {1 2 3 4 5} {
        set token [eval [list http::geturl $url] $args]
        if {![string match {30[1237]} [::http::ncode $token]]} {return $token}
        array set meta [set ${token}(meta)]
        if {![info exist meta(Location)]} {
            return $token
        }
        array set uri [::uri::split $meta(Location)]
        unset meta
        if {$uri(host) == ""} { set uri(host) $URI(host) }
        # problem w/ relative versus absolute paths
        set url [eval ::uri::join [array get uri]]
    }
}


proc bluray_pub {nick uhost hand chan text} {
    global bluray_availchans bluray_quitechans bluray_timeout bluray_outputstyle
   
    set bluray_keywords $text
    set bluray_output $bluray_outputstyle
   
    if {([lsearch -exact $bluray_availchans $chan] == -1) && ($chan != "privmsg")} {return}
    if {([lsearch -exact $bluray_quitechans $chan] != -1) || ($chan == "privmsg")} {set chan $nick}
   
    if {[string match $text ""]} {
        puthelp "PRIVMSG $chan :Usage: !bluray <movie title>"
        return
    } else { set bluray_keywords [lrange $text 0 end] }
   
   
    set bluray_keywords [string map { " " "+" "%" "+" "&" "+" "*" "+" "." "+"} $bluray_keywords]
   
    #   set bluray_url "http://www.blu-ray.com/search/?quicksearch=1&section=movies&keyword=$bluray_keywords&sortby=popularity"
    set bluray_url "http://www.blu-ray.com/search/?quicksearch=1&section=movies&quicksearch_keyword=$bluray_keywords&searchbutton.x=0&searchbutton.y=0"
    catch {set page [geturl_followRedirects $bluray_url -timeout $bluray_timeout]} error
    if {[string match -nocase "*couldn't open socket*" $error]} {
        puthelp "PRIVMSG $chan :Error: Could not open socket to blu-ray.com, please try again later."
        ::http::cleanup $page
        return
    }
    if {[::http::status $page] == "timeout" } {
        puthelp "PRIVMSG $chan :Error: Timed out connecting to blu-ray.com, please try again later."
        ::http::cleanup $page
        return
    }
   
    set html [::http::data $page]
    ::http::cleanup $page
   
    set html [string map { "\r\n" "" "\n" "" "\\n" "" } $html]
   
    if {[regexp {<h3>(.*?)</h3></a>} $html match bluray_title] } {
       
        if {[regexp {<br><small style=\"color: #666666\">(.*?)</small><br>} $html match bluray_info] } {
           
            set bluray_infosplit [split $bluray_info "|"]
           
           
            set bluray_info_year "N/A"
            set bluray_info_studio "N/A"
            set bluray_info_releasedate "N/A"
            set bluray_info_rating "N/A"
            set bluray_info_length "N/A"
            for { set i 0 } { $i < 5 } { incr i } {
               
                set bluray_currentinfo [string trimleft [lindex $bluray_infosplit $i]]
                set bluray_currentinfo [string trimright $bluray_currentinfo]
               
                if {[regexp {^[0-9]{1,4}$} $bluray_currentinfo]} {
                    set bluray_info_year $bluray_currentinfo
                   
                }
                if {[regexp {^[0-9]{1,5}\smin$} $bluray_currentinfo]} {
                    set bluray_info_length $bluray_currentinfo
                }
                if {[regexp {((Q[0-9]\s|[A-z]{3}\s[0-9]{2},\s)[0-9]{4}|No\sRelease\sDate)} $bluray_currentinfo]} {
                    set bluray_info_releasedate $bluray_currentinfo
                }
                if {[regexp {^.*(R|r)ated.*$} $bluray_currentinfo]} {
                    set bluray_info_rating $bluray_currentinfo
                }
                if {![regexp {^[0-9]{4}$} $bluray_currentinfo] && ![regexp {^[0-9]*\smin$} $bluray_currentinfo] && ![regexp {^[A-z]{3}\s[0-9]{1,2},\s[0-9]{4}} $bluray_currentinfo] && ![regexp {^.*(R|r)ated.*$} $bluray_currentinfo] && ![regexp {((Q[0-9]\s|[A-z]{3}\s[0-9]{2},\s)[0-9]{4}|No\sRelease\sDate)} $bluray_currentinfo] && [regexp {[A-z0-9]{2,60}} $bluray_currentinfo]} {
                    set bluray_info_studio $bluray_currentinfo
                }
               
            }
           
            regsub -all -nocase "%title" $bluray_output $bluray_title bluray_output
            regsub -all -nocase "%studio" $bluray_output $bluray_info_studio bluray_output
            regsub -all -nocase "%year" $bluray_output $bluray_info_year bluray_output
            regsub -all -nocase "%length" $bluray_output $bluray_info_length bluray_output
            regsub -all -nocase "%rating" $bluray_output $bluray_info_rating bluray_output
            regsub -all -nocase "%releasedate" $bluray_output $bluray_info_releasedate bluray_output
           
            puthelp "PRIVMSG $chan :$bluray_output"
           
        } else {
            puthelp "PRIVMSG $chan :Could not retrieve coconut about $bluray_title"
        }
    } elseif {[regexp {<h2 class="title">(.*?)</h2>} $html match bluray_title]} {
        if {[regexp {<span class="subheading" style="color: #666666">(.*?)</span><br><br>} $html matched bluray_info]} {
           
            regsub -all {<[^>]+>} $bluray_info { } bluray_info_stripped
           
            set bluray_infosplit [split $bluray_info_stripped "|"]
           
            set bluray_info_year "N/A"
            set bluray_info_studio "N/A"
            set bluray_info_releasedate "N/A"
            set bluray_info_rating "N/A"
            set bluray_info_length "N/A"
           
            for { set i 0 } { $i < 5 } { incr i } {
               
                set bluray_currentinfo [string trimleft [lindex $bluray_infosplit $i]]
                set bluray_currentinfo [string trimright $bluray_currentinfo]
               
                if {[regexp {^[0-9]{1,4}$} $bluray_currentinfo]} {
                    set bluray_info_year $bluray_currentinfo
                }
                if {[regexp {^[0-9]{1,5}\smin$} $bluray_currentinfo]} {
                    set bluray_info_length $bluray_currentinfo
                }
                if {[regexp {((Q[0-9]\s|[A-z]{3}\s[0-9]{2},\s)[0-9]{4}|No\sRelease\sDate)} $bluray_currentinfo]} {
                    set bluray_info_releasedate $bluray_currentinfo
                }
                if {[regexp {^.*(R|r)ated.*$} $bluray_currentinfo]} {
                    set bluray_info_rating $bluray_currentinfo
                }
                if {![regexp {^[0-9]{4}$} $bluray_currentinfo] && ![regexp {^[0-9]*\smin$} $bluray_currentinfo] && ![regexp {^[A-z]{3}\s[0-9]{1,2},\s[0-9]{4}} $bluray_currentinfo] && ![regexp {^.*(R|r)ated.*$} $bluray_currentinfo] && !  [regexp {((Q[0-9]\s|[A-z]{3}\s[0-9]{2},\s)[0-9]{4}|No\sRelease\sDate)} $bluray_currentinfo] && [regexp {[A-z0-9]{2,60}} $bluray_currentinfo]} {
                    set bluray_info_studio $bluray_currentinfo
                }
               
            }
           
            regsub -all -nocase "%title" $bluray_output $bluray_title bluray_output
            regsub -all -nocase "%studio" $bluray_output $bluray_info_studio bluray_output
            regsub -all -nocase "%year" $bluray_output $bluray_info_year bluray_output
            regsub -all -nocase "%length" $bluray_output $bluray_info_length bluray_output
            regsub -all -nocase "%rating" $bluray_output $bluray_info_rating bluray_output
            regsub -all -nocase "%releasedate" $bluray_output $bluray_info_releasedate bluray_output
           
           
            puthelp "PRIVMSG $chan :$bluray_output"
           
        } else {
            puthelp "PRIVMSG $chan :The coconut is broken."
        }
    } else {
       
        if {[regexp {alt=\"United\sKingdom\"\stitle=\"United\sKingdom\"\s\/><br><br>(.{100,250}?)<br><br><h5>} $html match bluray_noresult] } {
            set bluray_noresult [string map {"<b>" "\002" "</b>" "\002"} $bluray_noresult]
            regsub -all "results" $bluray_noresult "coconuts" bluray_coconuts
            puthelp "PRIVMSG $chan :$bluray_coconuts"
        } else {
            puthelp "PRIVMSG $chan :Could not fetch any search result or error message. The coconut is probably outdated."
        }
       
    }
   
   
}

putlog "Blu-ray.com script $bluray_version by dalys LOADED"


edit: forgot to edit 2 lines.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber