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 

IMDb Movies Now Playing, Top10 & Coming Soon
Goto page 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
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Aug 17, 2007 1:14 pm    Post subject: IMDb Movies Now Playing, Top10 & Coming Soon Reply with quote

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.
Back to top
View user's profile Send private message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Fri Aug 17, 2007 3:08 pm    Post subject: Reply with quote

Great job ! Smile .. but:

Quote:

Tcl error [nip_pub]: char map list unbalanced


I get this error message.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Aug 17, 2007 4:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Fri Aug 17, 2007 5:19 pm    Post subject: Reply with quote

Sorry my bad - right-click/save-as - that worked Smile

Thanxs and sorry
Back to top
View user's profile Send private message
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Sun Dec 09, 2007 1:18 pm    Post subject: Reply with quote

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:

[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:

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

Code:

                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
_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Dec 09, 2007 3:23 pm    Post subject: Reply with quote

Your first regex only gets:

Code:

<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>
Back to top
View user's profile Send private message
jackblack
Voice


Joined: 04 Dec 2007
Posts: 17

PostPosted: Sun Dec 09, 2007 10:01 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Mon Dec 10, 2007 1:00 am    Post subject: Reply with quote

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

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:

<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>

_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Mon Dec 10, 2007 2:09 am    Post subject: Reply with quote

ok fixed the channel problem.. Thanks Smile
_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Dec 10, 2007 6:24 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Tue Dec 11, 2007 3:34 am    Post subject: Reply with quote

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. Smile
_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Dec 11, 2007 10:29 am    Post subject: Reply with quote

Quote:
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:

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.
Back to top
View user's profile Send private message
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Tue Dec 11, 2007 2:43 pm    Post subject: Reply with quote

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
_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Dec 11, 2007 9:53 pm    Post subject: Reply with quote

It'll read whatever you give it a regex for. You can check the contents of your regexp variables with putcmdlog "$varname"
Back to top
View user's profile Send private message
LivingSouL
Voice


Joined: 04 May 2007
Posts: 15
Location: Davao

PostPosted: Wed Dec 12, 2007 12:37 am    Post subject: Reply with quote

it displays this one
Code:

<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
_________________
http://www.chatx.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
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 1, 2, 3  Next
Page 1 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