Personal Video Database

English => Development => Topic started by: Thiezar on January 28, 2012, 06:21:28 pm

Title: Is there a way to have two search URLs in scripts?
Post by: Thiezar on January 28, 2012, 06:21:28 pm
Hello guys.
I wonder if scripts could check 2 search strings.
The site I'm doing the script for have a search string like " www.site.com/search.php?actor='actorname'&director='directorname' ".
Since scripts have only one search string, in this case a string like " www.site.com/search.php?actor=%s&director=%s " will fail its purpose.
I would have to check two strings like this:
" www.site.com/search.php?actor=%s&director='' "
" www.site.com/search.php?actor=''&director=%s "
So I could gather all search results from this two searchs.

Is it possible? How?
Title: Re: Is there a way to have two search URLs in scripts?
Post by: nostra on January 28, 2012, 08:06:00 pm
You can retrieve the actor name and director name yourself and insert both of them manually into the URL.

Use function GetFieldValueXML(AField : String) : String;  to get the needed data.

Use this manual for more detailed information: http://www.videodb.info/help/hlp_scripting.html
Title: Re: Is there a way to have two search URLs in scripts?
Post by: Thiezar on January 29, 2012, 04:11:46 pm
A reply directly by nostra! :-) WOW!

Well, my problem is not to retrieve actor and director name, it's related on the way the site's search engine works.
Let's say I would like to search for information on Jack Brown.
I have only ONE search string tu use.

So my idea is to add search results first form this url www.site.com/search.php?actor=%s&director= and then from this  www.site.com/search.php?actor=&director=%s, but I don't know how to do this.
Title: Re: Is there a way to have two search URLs in scripts?
Post by: nostra on January 30, 2012, 02:38:54 am
Just get results from the first url if you have no results, then return 0 in GetCurrentMode and return another URL in GetDownloadURL, then parse the results of the second URL.
Or if you want to have all results combined:
Get the first set of results save it in memory and return 2 in ParsePage, but do not return any search results and do not change the mode returned in GetCurrentMode. Then get the second set of results, return 2 in ParsePage and do not forget to AddSearchResult boths sets of results this time.