English > Scripts and Templates
HOW can I get the clicked URL of the SearchResults list
mgpw4me:
Finally looking at this....
I'm researching the exact process required by HTTP 1.1 standards for the POST method. I've noted the Impawards poster plugin isn't working (for me), and it requires POST for search and GET for data...and it requires minimal post variable passing. I didn't count, but filmportal looks like it requires at least 6 variables to be passed in the POST, so I'll do an example with Impawards, and expand on it (maybe tomorrow) for dealing with multiple search pages.
mgpw4me:
My apologies for being so slow.
I've been sidetracked by making the script as flexible and easy to use as possible, while providing a "good" solution to the problem. I'd prefer that the script be a good example for others trying to do the same thing (note: Pascal isn't my favorite language so it's taking longer than I'd like), and have been trying to make it portable...within the Windows and Wine environments (Wine support will be very limited).
I might post a zip file tomorrow. If not. then the next day for sure.
meriator:
my script is working
except my navigation buttons which need the POST METHOD instead GET
which I have to add
in case there are more then 10 items found
what means the searchresult page contains navigation buttons too
the navigation urls(POST) must contain ALL hidden form inputs
they vari from search to search depending on paging page and result of pages
plus
--- Code: ---
this field value must be searched and set
FF___FF__DF4425363084591DE0340003BA5CE267_0___Value=???
this field value
EncodingCheckString=ue
must be set manually and should be excluded from parsed hiddens
(do NOT parse or set the org value "ü", to prevent miss URLencodings)
this field value
FF___FF__DF4425363084591DE0340003BA5CE267_1___Value=2
must be set manually and should be excluded from parsed hiddens
it should be "2" (titlesearch)
do not parse the action
because it sometimes contains ";jsessionid=value[a-z|0-9]{10}" before "?"
(which also lead to miss URLencodings )
take this as default action URL instead
http://www.filmportal.de/dif/?FormName=PublicSearchForm&NavID=SimpleSearch&
the submit for navigation should be set like this
FF___ResultPager_%s___Value=%s
--- End code ---
everything works perfekt so far
my script is multilang (en/de) for most of the data results
except this POST/GET thing :(
I'm very excitedly for a solution
( while me still believing its impossible for scripts currently )
cu meriator
mgpw4me:
--- Quote from: meriator on December 29, 2011, 05:18:50 am ---
I'm very excitedly for a solution
( while me still believing its impossible for scripts currently )
--- End quote ---
procedure FileExecute(const AFileName : String; const Params : String);
Opens a specified file with the application associated with its file type or starts another application if an executable file is specified.
Parameters:
AFileName file to open or execute
Params command line parameters to pass with the file
I started writing code this afternoon.
My plan for POST / GET is to load a web page to the hard drive, remove <script> tags (I hate pop-ups) and load it into a browser IFRAME under script control, do the initial search, have the user click a "save" button when they get to the right page, then pass the html from the IFRAME back to the .PSF file via a text file. No passing post variables, no parsing of search results...the web site html takes care of the navigation. Since the html will be accessible via javascript, the possibility exists to use the Document Object Model to process the html file for some information, rather than parsing it in the PSF file. For example, with posters, I'll be able to look at the document.images collection without any messy string processing.
mgpw4me:
I've been way too busy, so the following code is not even close to 'ready', but it does provide proof the method will work.
Some data about the activex component used is here:
http://www.the-art-of-web.com/javascript/ajax/
At the moment, what is does:
- Psf file invokes the HTA (HyperTExt Application)
- HTA uses GET to load the source code for the impawards.com index page into a textarea
- HTA can save the textarea to a file
- the activex component is 'standard' on windows xp and up...no install required
Known issues:
ActiveXObject('msxml2.xmlhttp') works for VISTA, other objects are used by other O/S's. The loadXMLDoc(url, params) subroutine shows how to connect to the correct object.
POST isn't supported by this code...at the moment...but it looks simple enough...in fact it could be possible to write a generic "read the <input> tags" routine to build most of the post variables on-the-fly.
Very unlikely this code will work on anything but a "genuine windows" install.
The FileExecute routine will NOT wait for the executable to finish before continuing. You can either create a file and wait for it to be deleted by the HTA (you'll probably want a TIMEOUT value on the loop), or use the TASKLIST command (maybe in a batch file...TASKLIST > activetasks.txt) and check to see if the hta is active.
----------------------
I'll update this code as I have time, but meanwhile I hope it gives you a starting point.
BTW, the second file, posterconfig.zip contains a user interface configuration dialog. Not very refined, but it works.
[attachment deleted by admin]
Navigation
[0] Message Index
[*] Previous page
Go to full version