| View previous topic :: View next topic |
| Author |
Message |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Aug 17, 2007 1:14 pm Post subject: IMDb Movies Now Playing, Top10 & Coming Soon |
|
|
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 |
|
 |
Elfriede Halfop
Joined: 07 Aug 2007 Posts: 67
|
Posted: Fri Aug 17, 2007 3:08 pm Post subject: |
|
|
Great job ! .. but:
| Quote: |
Tcl error [nip_pub]: char map list unbalanced
|
I get this error message. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Aug 17, 2007 4:58 pm Post subject: |
|
|
| 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 |
|
 |
Elfriede Halfop
Joined: 07 Aug 2007 Posts: 67
|
Posted: Fri Aug 17, 2007 5:19 pm Post subject: |
|
|
Sorry my bad - right-click/save-as - that worked
Thanxs and sorry |
|
| Back to top |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Sun Dec 09, 2007 1:18 pm Post subject: |
|
|
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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Dec 09, 2007 3:23 pm Post subject: |
|
|
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 |
|
 |
jackblack Voice
Joined: 04 Dec 2007 Posts: 17
|
|
| Back to top |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Mon Dec 10, 2007 1:00 am Post subject: |
|
|
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: |
<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 |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Mon Dec 10, 2007 2:09 am Post subject: |
|
|
ok fixed the channel problem.. Thanks  _________________ http://www.chatx.net |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Dec 10, 2007 6:24 am Post subject: |
|
|
Of course it's possible. Learn regexp  |
|
| Back to top |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Tue Dec 11, 2007 3:34 am Post subject: |
|
|
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.  _________________ http://www.chatx.net |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Dec 11, 2007 10:29 am Post subject: |
|
|
| 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 |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Tue Dec 11, 2007 2:43 pm Post subject: |
|
|
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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Dec 11, 2007 9:53 pm Post subject: |
|
|
| 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 |
|
 |
LivingSouL Voice

Joined: 04 May 2007 Posts: 15 Location: Davao
|
Posted: Wed Dec 12, 2007 12:37 am Post subject: |
|
|
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 |
|
 |
|