forked from blallo/rss-bridge
[t411] Increase item limit
On searches for popular keywords, a feed reader not reading the feed often enough can miss items (ie more than 5 items were added since last fetch) so this change increases the limit from 5 items to 10 items, and retrieves pages faster to compensate (500ms seems enough for not spamming t411).
This commit is contained in:
parent
bba6a0b5c2
commit
91fe6c4acc
1 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ class T411Bridge extends BridgeAbstract {
|
||||||
$this->name = "T411";
|
$this->name = "T411";
|
||||||
$this->uri = "https://t411.in/";
|
$this->uri = "https://t411.in/";
|
||||||
$this->description = "Returns the 5 newest torrents with specified search terms <br /> Use url part after '?' mark when using their search engine";
|
$this->description = "Returns the 5 newest torrents with specified search terms <br /> Use url part after '?' mark when using their search engine";
|
||||||
$this->update = "2015-12-17";
|
$this->update = "2016-02-06";
|
||||||
|
|
||||||
$this->parameters[] =
|
$this->parameters[] =
|
||||||
'[
|
'[
|
||||||
|
@ -46,10 +46,10 @@ class T411Bridge extends BridgeAbstract {
|
||||||
foreach($results->find('tr') as $element) {
|
foreach($results->find('tr') as $element) {
|
||||||
|
|
||||||
//Limit total amount of requests
|
//Limit total amount of requests
|
||||||
if ($limit < 5) {
|
if ($limit < 10) {
|
||||||
|
|
||||||
//Requests are rate-limited
|
//Requests are rate-limited
|
||||||
sleep(1); //So we need to wait
|
usleep(500000); //So we need to wait (500ms)
|
||||||
|
|
||||||
//Retrieve data from RSS entry
|
//Retrieve data from RSS entry
|
||||||
$item_uri = 'http://'.ExtractFromDelimiters($element->outertext, '<a href="//', '"');
|
$item_uri = 'http://'.ExtractFromDelimiters($element->outertext, '<a href="//', '"');
|
||||||
|
@ -66,7 +66,7 @@ class T411Bridge extends BridgeAbstract {
|
||||||
//Retrieve image for thumbnail or generic logo fallback
|
//Retrieve image for thumbnail or generic logo fallback
|
||||||
$item_image = 'http://www.t411.in/themes/blue/images/logo.png';
|
$item_image = 'http://www.t411.in/themes/blue/images/logo.png';
|
||||||
foreach ($item_desc->find('img') as $img) {
|
foreach ($item_desc->find('img') as $img) {
|
||||||
if (strpos($img->src, 'dreamprez') === false) {
|
if (strpos($img->src, 'prez') === false) {
|
||||||
$item_image = $img->src;
|
$item_image = $img->src;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue