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 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
rosc2112
Revered One


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

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

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:

</table>
                                                </td>


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

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:

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:

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.
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 2:34 am    Post subject: Reply with quote

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.. Smile
_________________
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: Thu Mar 20, 2008 12:43 pm    Post subject: Help Reply with quote

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:

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

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

_________________
http://www.chatx.net


Last edited by LivingSouL on Tue Apr 01, 2008 10:16 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Mar 20, 2008 3:28 pm    Post subject: Re: Help Reply with quote

LivingSouL wrote:
Code:
      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:
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.
Back to top
View user's profile Send private message
rosc2112
Revered One


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

PostPosted: Thu Mar 20, 2008 9:00 pm    Post subject: Reply with quote

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


Joined: 14 Dec 2007
Posts: 74

PostPosted: Sun Apr 27, 2008 4:36 pm    Post subject: Reply with quote

Returning 'No movie data found.' currently.
Back to top
View user's profile Send private message MSN Messenger
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Apr 27, 2008 4:52 pm    Post subject: Reply with quote

shadrach wrote:
Returning 'No movie data found.' currently.

Mine works fine, no clue what you meant there.
Back to top
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Sun Apr 27, 2008 5:49 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Apr 28, 2008 9:27 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Tue Apr 29, 2008 9:06 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Apr 30, 2008 11:13 pm    Post subject: Reply with quote

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=Downloads&op=getit&lid=10
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Fri May 02, 2008 5:23 pm    Post subject: Reply with quote

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=Downloads&op=getit&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.
Back to top
View user's profile Send private message MSN Messenger
StoN3d
Voice


Joined: 04 May 2008
Posts: 1

PostPosted: Sun May 04, 2008 1:46 pm    Post subject: Reply with quote

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


Joined: 21 Jan 2006
Posts: 35

PostPosted: Mon May 19, 2008 12:51 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


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

PostPosted: Mon May 19, 2008 5:06 pm    Post subject: Reply with quote

As well as reply in the right thread, this one is for the NOW PLAYING script I wrote, not the Imdb script OV2 wrote =)
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