[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Extract Next & Previous URLS with Perl
****** message to minivend-users from minivend@hq.com.au ******
Hello Fellow Users,
We are trying to extract the next and back urls from a search result page.
The [more] tag produces this;
<A HREF="http://test.com.au/cgi-bin/organic/scan/MM=8d306278596ba581d024ec
12bdcd091c:25:49:25?mv_session_id=7t9C7W9F&mv_nextpage=results">Previous</A>
<A
HREF="http://test.com.au/cgi-bin/organic/scan/MM=8d306278596ba581d024ec12bdc
d
091c:0:24:25?mv_session_id=7t9C7W9F&mv_nextpage=results">1</A>
<A
HREF="http://test.com.au/cgi-bin/organic/scan/MM=8d306278596ba581d024ec12bdc
d
091c:25:49:25?mv_session_id=7t9C7W9F&mv_nextpage=results">2</A>
<STRONG>3</STRONG>
<A
HREF="http://test.com.au/cgi-bin/organic/scan/MM=8d306278596ba581d024ec12bdc
d
091c:75:78:25?mv_session_id=7t9C7W9F&mv_nextpage=results">4</A>
<A
HREF="http://test.com.au/cgi-bin/organic/scan/MM=8d306278596ba581d024ec12bdc
d
091c:75:78:25?mv_session_id=7t9C7W9F&mv_nextpage=results">Next</A>
We are trying to extract Only the Next and the previous urls, declare them
as variables and dump any urls in the middle...
We are trying to use this code.. to no avail.
[more-list][set mv_put_session][more][/set][/more-list]
[perl arg=values interpolate=1]$var = '[scratch mv_put_session]';
@lines=split(/\n/,$var);
foreach(@lines){
chomp;
if (/<A HREF="?(.*)?">(Previous|Next)<\/A>/){
$$2=$1;
}
}
return $Previous;
return $Next;
[/perl]
WHY...
We have a page with many items with quantiy boxes and will then will use the variables to direct the mv_nextpage to place in the basket and show the next or previous results page instead of a basket contents.
Any help is appreciated.
Regards,
Geoff
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list