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.

IMDb Movies Now Playing, Top10 & Coming Soon

Support & discussion of released scripts, and announcements of new releases.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

IMDb Movies Now Playing, Top10 & Coming Soon

Post by rosc2112 »

Ok, so I made a script to pull the Now Playing stuff from IMDb:

http://members.dandy.net/~fbn/nip.tcl.txt

Uploaded to archive as well.
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

Great job ! :) .. but:
Tcl error [nip_pub]: char map list unbalanced
I get this error message.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I don't get any errors, did a restart to make sure I didn't have vars still in memory.. Diff'd the copy on my drive with the one on the webpage too, they're the same. I can only assume you cut/paste saved the file instead of right-click/save-as or perhaps your version of tcl is outdated.
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

Sorry my bad - right-click/save-as - that worked :)

Thanxs and sorry
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

Hello...

I've tried my best to modify the script for this site http://www.nccc.com.ph/cinema/ but the bot didnt return any results:

Code: Select all

[23:22] <LivingSouL> .movies now
[23:22] <DavaoCurrentAffairs> Movies Now Playing:
[23:22] <DavaoCurrentAffairs> [End of Movies Now Playing]
I dont know if I did this right.. a help would be appreciated.. thanks

Code: Select all

        if {$command == "" || $command == "now"} {
                set regexm {<div id="nowshowing">.*?<td valign='top'>(.*?)</td>}

Code: Select all

                regsub -all {<a href.*?>} $moviedata {} moviedata
                regsub -all {</a>} $moviedata {} moviedata
                set movienames [regexp -all -inline {<div class='h1'>(.*?)</div>} $moviedata]
                regsub -all {<div class='h1'>.*?</div>} $movienames {} movienames
 
Could you guys help me? Thanks
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Your first regex only gets:

Code: Select all

<div id="nowshowing">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class='padd'>

								<table width='100%' border='0' cellspacing='0' cellpadding='2'>
									<tr>
										<td valign='top'>
										<a href='info.php?nowshowing=133'><img src=http://www.nccc.com.ph/admin/_userfiles/cinema/thumb/133.jpg width='108' class='image'/></a>
										</td>
j
jackblack
Voice
Posts: 17
Joined: Tue Dec 04, 2007 1:41 am

Post by jackblack »

would it be possible to alter this script to go off uk cinima coming soon,now showing,perhaps http://uk.movies.yahoo.com/now-showing.html
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

First of all, im sorry i double posted... my bad.. :(

Thank you so much for this, it helped alot... now displays the movies, im trying to figure out the links.

and one thing, my bot is on 2 channels and it only replies on the other chan, but i've listed both channels in moviechans
rosc2112 wrote:Your first regex only gets:

Code: Select all

<div id="nowshowing">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class='padd'>

								<table width='100%' border='0' cellspacing='0' cellpadding='2'>
									<tr>
										<td valign='top'>
										<a href='info.php?nowshowing=133'><img src=http://www.nccc.com.ph/admin/_userfiles/cinema/thumb/133.jpg width='108' class='image'/></a>
										</td>
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

ok fixed the channel problem.. Thanks :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

jackblack wrote:would it be possible to alter this script to go off uk cinima coming soon,now showing,perhaps http://uk.movies.yahoo.com/now-showing.html
Of course it's possible. Learn regexp :)
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

hello ros,

can you help me about this one? how do we get regexp of two websites? they are diffrent cinemas here in my town, i want to gather entries about those two cinemas. can you guide me? i'll try my best doing it. :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

can you help me about this one? how do we get regexp of two websites? they are diffrent cinemas here in my town, i want to gather entries about those two cinemas. can you guide me?
Personally, I'd make 2 seperate scripts, one for each website.

Otherwise, if you look at how I did the if/elseif in my script, you could do it that way, althought that'll be more complicated if the 2 websites html is very different. Something like:

Code: Select all

if {$command == "option1"} {
       set url "http://website1/page.html"
       set regexpm "whatever needed for website1"
} elseif {$command == "option2"} {
     set url "http://website2/page2.html"
    set regexpm "whatever needed for website2
}
set html [::http::data $url]
# then process the html data to get the results, which will probably need more if/elseif tests to clean up based on which option was used on the commandline.
Anyway, that's all demonstrated in my original script.
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

ok now,

i know i've done it right. it suppose to have a result on the 2nd site.. but nothing...the bot will PM you saying No movie data found. hmmmm

does eggdrop read urls like this? http://smcinema.com/listings.aspx?cat=22
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

It'll read whatever you give it a regex for. You can check the contents of your regexp variables with putcmdlog "$varname"
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

it displays this one

Code: Select all

<td colspan="2">.*?<table width="100%">(.*?)</table></td>
which is what my regexp on the 2nd website.

so im supposing it doesnt read contents from this URL
http://smcinema.com/listings.aspx?cat=22
Post Reply