Personal Video Database
English => Development => Topic started 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?
-
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
-
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.
- SEARCH_STR := ' www.site.com/search.php?actor=%s&director=%s'
In this case the site's search engine will return all movies where Jack Brown is both director and actor. Useless.
- SEARCH_STR := ' www.site.com/search.php?actor=%s&director='
In this case the site's search engine will return all actors named Jack Brown. If Jack Brown is actually an actor it is great. If he's a director it is useless.
- SEARCH_STR := ' www.site.com/search.php?actor=&director=%s'
In this case the site's search engine will return all directors named Jack Brown. If Jack Brown is actually a director it is great. If he's an actor it is useless.
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.
-
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.