Merge pull request #444 from niawag/patch-3
[ThePirateBay] Filter results by user status (VIP/Trusted/None)
This commit is contained in:
commit
271c71d0ac
1 changed files with 21 additions and 11 deletions
|
@ -29,6 +29,10 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
'name'=>'Category number',
|
||||
'exampleValue'=>'100, 200… See TPB for category number'
|
||||
),
|
||||
'trusted'=>array(
|
||||
'type'=>'checkbox',
|
||||
'name'=>'Only get results from Trusted or VIP users ?',
|
||||
),
|
||||
));
|
||||
|
||||
public function collectData(){
|
||||
|
@ -72,6 +76,8 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
$catNum = $this->getInput('cat');
|
||||
}
|
||||
$critList = $this->getInput('crit');
|
||||
|
||||
$trustedBool = $this->getInput('trusted');
|
||||
$keywordsList = explode(";",$this->getInput('q'));
|
||||
foreach($keywordsList as $keywords){
|
||||
switch ($critList) {
|
||||
|
@ -102,6 +108,9 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('tr') as $element) {
|
||||
|
||||
if ( !$trustedBool or !is_null($element->find('img[alt=VIP]', 0)) or !is_null($element->find('img[alt=Trusted]', 0)) )
|
||||
{
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('a',3)->href;
|
||||
$item['id'] = self::URI.$element->find('a.detLink',0)->href;
|
||||
|
@ -116,4 +125,5 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue