Bit Che > Scripts & Development
multi-page support
chip!:
using the latest beta with the new functions resubmit() and getcookie(), we are able to achieve a working multi-page search... attached is a proof in concept, except that it does not respect the BC->search result limit because this is a rather nifty hack on the script engine using a cookie as a 'settings' variable and resubmiting the request until there are no more results.. hmm :)
chip!:
this POC will still work with the latest builds of BC.. however, proper/standardized multi-page support has been enabled and will be available in any built 2.0.71+
CuF:
Is multipage officially supported now? I tried playing with the sample script and I'm definitely a bit lost on how to implement it.
chip!:
yeah, it has been working for the scripts that are enabled.. here was a little write up on how to use it (i suppose you have seen this): http://convivea.com/forums/index.php/topic,2398.0.html
basically,
a. you just add "[nextpage]" section to the .ini
b. set 'morepages=' for the exact HTML that BC should search for to indicate that there is more pages to fetch.. normally this would be some HTML associated with a 'More' button.. or 'Next'.. usually on the webpage there will be a specific button to go to the next result page, or an icon image that represents there are more pages.
c. then configure type=1 and initial=1 (see the little descriptions of each)
d. and finally, make sure to use %PAGENUM% var in your Search URL. when BC finds the 'morepages=' HTML in the results, it then updates the search URL to fetch the next page.
this script is working: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/KickassTorrents.com.ini
but let me know where you are getting stuck so i can help better :)
chip!:
as an example, for the new btdigg script, I would try setting
--- Code: ---morepages=>Next →</a>
--- End code ---
because that Next button always has a link if there are more pages, but when you get to the last page, the button loses the href link, and becomes:
--- Code: ---<td>Next →</td>
--- End code ---
so Bit Che would not try to fetch any more pages because the 'morepages=' html would not be found in the last page (since the
--- Code: ---</a>
--- End code ---
is not there on the last page).
and for the others:
type=1 (because the pages counts sequentially, 1, 2, 3, 4, etc)
initial=0 (because the first page is
--- Code: ---/search?q=search&p=0
--- End code ---
(page 1 actually starts at page 0..)
and then for the search URL:
--- Code: ---/search?q=%SEARCH%&p=%PAGENUM%
--- End code ---
I haven't tried it yet, but just looking at the page, i think that would work.. let me know?
Navigation
[0] Message Index
[#] Next page
Go to full version