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

Post by rosc2112 »

The last bit of your regexp doesn't take into account the carriage returns in the page:

You have:
</table></td>

The webpage has:

Code: Select all

</table>
																</td>
You probably don't need the </td> anyway, as the html is very simple, so this bit should get your data:

Code: Select all

regexp {table width="100%">(.*?)</table>} $html match data
Then you'll have to clean things up. One thing to note, putcmdlog won't show you data if there's carriage returns, so you can either strip them out first with regsub, or use a foreach loop:

Code: Select all

foreach line [split $data \n] {
        putcmdlog "line '$line'"
}
Once you have your block of data, this should clean up the data and give you just the movie titles:

Code: Select all

regsub -all {<td width="43%" valign="top">(.*?)</td>} $data {\1} outputvar

foreach line [split $outputvar \n] {
       set line [string trim $line]
        if {$line != ""} {
              putcmdlog "line '$line'"
        }
}
One peculiarity I've noticed when using regsub's substitutions (like \& \0 \1 etc) is it inserts bold codes and IIIIIII's into the output.. string trim seems to work to get rid of them in otherwise empty lines. You'll probably see it in the raw output.
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Post by LivingSouL »

argh....

Sorry for my fault... silly me.. I forgot to comment the line that redirects back to the 1st site... that explains why it detects no data... sorry... its ok now.. thank you very much for the help.. I appreciate it.. :)
User avatar
LivingSouL
Voice
Posts: 15
Joined: Fri May 04, 2007 11:30 am
Location: Davao
Contact:

Help

Post by LivingSouL »

I accidentally deleted your old movies script that I was using on my channel. and now, I'm confused on why it is displaying these:

Code: Select all

[00:40] <LivingSouL> .movies nccc
[00:40] <Davao> Movies Now Playing at NCCC Cinemas:
[00:40] <Davao> 1) {
[00:40] <Davao> 2) } {ONE MISSED CALL} {
[00:40] <Davao> 3) } {10,000 BC} {
[00:40] <Davao> 4) } {MY BIG LOVE} {
[00:40] <Davao> 5) } {DRAGON WAR}
[00:40] <Davao> [End of Movies Now Playing at NCCC Cinemas]
Here's the code I've partially modified:

Code: Select all

   if {$command == "" || $command == "NCCC" || $command == "nccc"} {
      set movieurl "http://www.nccc.com.ph/cinema/"
      set regexm {<td valign='top'>(.*?)</td></tr></table>}
      set moviehead "Movies Now Playing at NCCC Cinemas"
   }
Last edited by LivingSouL on Tue Apr 01, 2008 10:16 pm, edited 1 time in total.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Help

Post by speechles »

LivingSouL wrote:

Code: Select all

      set movienames [regexp -all -inline {<div class='h1'>(.*?)</div>} $moviedata]
      ... snipped irrelevant sections...
      regsub -all {\n} $movienames "\n" movienames 
      ... snipped irrelevant sections...
      foreach name [split $movienames \n] { 
This is your problem, your removing all newline elements from that movienames list (using regsub, on a list?!). Then a few lines down, you attempt to split it (it's already a list, why do you split it?!) using newline (after you already removed newline with that silly regsub). Do you see why this can't be done silly? Instead, use this:

Code: Select all

foreach name $movienames {
movienames doesn't need to be split, it's already an inline list built by the regexp. Splitting it again in effect adds those curly bracings your seeing. Split protects existing special characters by escaping them. So by splitting twice, you are asking the interpreter to protect those curly braces for display, rather than use them to encapsulate list elements and fields.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

1) You posted in the wrong thread. The script you broke is the Movietome script, not the IMDB-now playing script

2) YOU broke it by modifying it. My copy works just fine, I just checked.

You broke it, you get to fix it :)
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Returning 'No movie data found.' currently.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

shadrach wrote:Returning 'No movie data found.' currently.
Mine works fine, no clue what you meant there.
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Whereas previously the script would return the intended info about movie charts and pending releases to the channel, it now returns a 'No movie data found.' message in privmsg. I thought imdb.com might have changed something but perhaps not if your test is successful.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

shadrach wrote:Returning 'No movie data found.' currently.
Did you perchance edit the script with a windoze editor? Non conforming EOL (hidden) characters are added and in most cases cause unexpected results in Tcl scripts within a Unix environment.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Alchera wrote:
shadrach wrote:Returning 'No movie data found.' currently.
Did you perchance edit the script with a windoze editor? Non conforming EOL (hidden) characters are added and in most cases cause unexpected results in Tcl scripts within a Unix environment.
No. The script has been functioning fine for several weeks since it was installed. The change in behaviour seems quite spontaneous. Another thing, although pertaining to a different script this concerns imdb.com again, the imdb.tcl in the archive ((c) 2003 by B0unTy, revised last by by OV2 21.09.2007) has stopped returning Cert and Plot info. - not plot keywords. This occurred around the same time as the 'Now Playing' script problem arose.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I use the version from http://overfiend.sessionclan.de/.

It appears to return all relevant data using the default normal announce.

That file is also cached @ http://www.ballarat.us/modules.php?name ... tit&lid=10
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Alchera wrote:I use the version from http://overfiend.sessionclan.de/.

It appears to return all relevant data using the default normal announce.

That file is also cached @ http://www.ballarat.us/modules.php?name ... tit&lid=10
Yes that's the version I use. The default info is returned. I added Cert and Plot cookies which were returning the info from imdb.com until last week but now those lines are blank. All other cookies work.
The Now Playing script on the other hand returns nothing in channel and in privmsg just the No movie data found. message.
S
StoN3d
Voice
Posts: 1
Joined: Sun May 04, 2008 1:43 pm

Post by StoN3d »

I am having the SAME EXACT problems with the IMDB and NOW Playing scripts and iI have not touched a thing.
They were working now all i get is Data not found in a pm and it will not post the Plot info.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

shadrach: I've fixed the broken cookies

If you notice something like that you can simply drop me a mail and I'll look into it.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

As well as reply in the right thread, this one is for the NOW PLAYING script I wrote, not the Imdb script OV2 wrote =)
Post Reply