Author Topic: Is there a way to have two search URLs in scripts?  (Read 7535 times)

0 Members and 1 Guest are viewing this topic.

Offline Thiezar

  • Member
  • *
  • Posts: 16
    • View Profile
Is there a way to have two search URLs in scripts?
« 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?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Is there a way to have two search URLs in scripts?
« Reply #1 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
Gentlemen, you can’t fight in here! This is the War Room!

Offline Thiezar

  • Member
  • *
  • Posts: 16
    • View Profile
Re: Is there a way to have two search URLs in scripts?
« Reply #2 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.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Is there a way to have two search URLs in scripts?
« Reply #3 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.
Gentlemen, you can’t fight in here! This is the War Room!

 

anything