forked from blallo/rss-bridge
Filter results by user status (VIP/Trusted/None)
This commit is contained in:
parent
b4e6c0d973
commit
8bb002c7b6
1 changed files with 29 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,17 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('tr') as $element) {
|
||||
$skip = FALSE;
|
||||
|
||||
if ($trustedBool)
|
||||
{
|
||||
$element_str = (string)$element;
|
||||
if (strpos($element_str, 'VIP') == FALSE and strpos($element_str, 'Trusted') == FALSE )
|
||||
$skip = TRUE;
|
||||
}
|
||||
|
||||
if ( $skip == FALSE )
|
||||
{
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('a',3)->href;
|
||||
$item['id'] = self::URI.$element->find('a.detLink',0)->href;
|
||||
|
@ -117,3 +134,4 @@ class ThePirateBayBridge extends BridgeAbstract{
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue