BinaryWorks.it Official Forum
BinaryWorks.it Official Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 eXtreme Movie Manager (Rel. 7), No More Updates
 Scripts
 IMDB Top 250 Script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hoodric
Starting Member

Taiwan
6 Posts

Posted - 04 Nov 2007 :  09:03:07  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to write a script that will take a movies position on the IMDB Top 250 list if the movie is on it. This is my first attempt at writing a script though and I can't seem to get it to work.

I've used the start of the IMDB (Fastest) script to reset all the variables and get the directlink from CUSTOM8. I've then written my own bit of script to try and read the Top 250 information if the page has it but it's not working. Any ideas where i'm going wrong?

Here is the part I wrote -

--IMDBTOP250--------------------------------------------------------------------------------

#CUSTOM1#

#STARTREADWEB#
#FIND#=<a href="/chart/top?#48##ONERROR#=*OK*
#IF# #48#==#00#
#GOTO#=ENDTAKECUSTOM1
#ENDIF#
#FIND#=Top 250: #11##ONERROR#=*STOP*
#FIND#=</a>#12##ONERROR#=*STOP*
#TAKEWORD#=#20#,#11#,#12#
#CUSTOM1VALUE#=#20#



:ENDTAKECUSTOM1
#RESTOREWEB#
#RESTOREMAIN#

#ENDCUSTOM1#

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 05 Nov 2007 :  11:38:23  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ,

You have to use the FINDLINE and not the FINF for the "<a href="/chart/top?#48##ONERROR#=*OK*"

And you have to use this (I will upload the modified script in few minutes)

--IMDBTOP250--------------------------------------------------------------------------------
#CUSTOM1#

#RESTOREMAIN#
#STARTREADWEB#
#FINDLINE#=/chart/top?#15##ONERROR#=*OK*
#IF# #15#==#00#
#GOTO#=ENDTAKECUSTOM1250
#ENDIF#
#FIND#=>Top 250: #11##ONERROR#=*STOP*
#FIND#=</a>#12##ONERROR#=*STOP*
#TAKEWORD#=#13#,#11#,#12#
#TAKECUSTOM1#=#13#

:ENDTAKECUSTOM1250

#ENDCUSTOM1#
Go to Top of Page

hoodric
Starting Member

Taiwan
6 Posts

Posted - 05 Nov 2007 :  18:22:30  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the help. It works perfectly.
Go to Top of Page

hoodric
Starting Member

Taiwan
6 Posts

Posted - 07 Nov 2007 :  11:08:42  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Maybe I spoke a little too soon. It didn't quite work how I wanted it to. The script imported the data fine, but XMM was unable to sort it into numerical order because of the "Top 250: #" tag before each number.

I added the following to the #CUSTOM1# and #DELETETAGS# sections to remove the words and leave me with just the number.

#CUSTOM1#
#STARTDELETETAGS#
#TRIM#

#DELETETAGS#
#DELETEWORD#=Top
#DELETEWORD#=250:
#DELETEWORD#=#

This removed the "Top 250: #" text but XMM was still unable to sort the data into numerical order due to the mixture of 1, 2 and 3 digit numbers.

I added a couple of #PUT# and #IF# statements to pad the numbers out to 3 digits. XMM can now sort the data numerically based on IMDB top 250 position.

Here is the altered script for anyone who wants it.

--IMDBTOP250--------------------------------------------------------------------------------
#CUSTOM1#

#PUT#=100#49#
#PUT#=10#50#
#RESTOREMAIN#
#STARTREADWEB#
#FINDLINE#=/chart/top?#15##ONERROR#=*OK*
#IF# #15#==#00#
#GOTO#=ENDTAKECUSTOM1250
#ENDIF#
#FIND#=>Top 250: #11##ONERROR#=*STOP*
#FIND#=</a>#12##ONERROR#=*STOP*
#TAKEWORD#=#13#,#11#,#12#
#STARTDELETETAGS#
#TRIM#
#IF# #13#<<#50#
#STRING#=#04#=00#13#
#TAKECUSTOM1#=#04#
#GOTO#=ENDTAKECUSTOM1250
#ENDIF#
#IF# #13#<<#49#
#STRING#=#04#=0#13#
#TAKECUSTOM1#=#04#
#GOTO#=ENDTAKECUSTOM1250
#ENDIF#


#TAKECUSTOM1#=#13#

:ENDTAKECUSTOM1250

#ENDCUSTOM1#

--DELETETAGS--------------------------------------------------------------------------------
#DELETETAGS#
#DELETEWORD#=Top
#DELETEWORD#=250:
#DELETEWORD#=#
Go to Top of Page

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 07 Nov 2007 :  11:18:39  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much Hoodric!!

I will update the script in few hours!

Alessio
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BinaryWorks.it Official Forum © Binaryworks.it Go To Top Of Page
Generated in 0.11 sec. Powered By: Snitz Forums 2000 Version 3.4.07