#dependencies: php, git and cronie
git clone
https://github.com/RSS-Bridge/rss-bridge.git /home/$USER/.rss-bridge
cat > /home/$USER/.rss-bridge/bridges/Torrent9Bridge.php << 'EOF'
<?php
class Torrent9Bridge extends BridgeAbstract
{
const NAME = 'Torrent9 Bridge';
const URI = '
https://www.torrent9.uno';
const DESCRIPTION = 'Returns latest films torrents';
public function collectData()
{
//get the html page
$page = self::URI . '/torrents_films.html';
$html = getSimpleHTMLDOM($page)
or returnServerError('No results for this query.');
//From the 1rt <table></table>, get the film torrent list
//In the 1rt <table></table>, each <tr></tr> is a film torrent description
foreach($html->find('table', 0)->find('tr') as $film)
{
if($film->parent->tag == 'tbody')
{
//From the 1rt <a></a> in the 1rt <td></td>, get the torrent title
//From the 2nd <td></td>, get the torrent files size
//From the 3rd <td></td>, get the nomber of torrent seeders
//From the 4th <td></td>, get the nomber of torrent leechers
//From the 1rt <a></a> in the 1rt <td></td>, get the uri
$item = array();
$item['title'] = $film->find('td', 0)->find('a', 0)->plaintext .
' (' . $film->find('td', 1)->plaintext . ')' .
' S:' . $film->find('td', 2)->plaintext .
' L:' . $film->find('td', 3)->plaintext;
$item['uri'] = self::URI . $film->find('td', 0)->find('a', 0)->href;
$this->items[] = $item;
}
}
}
}
EOF
echo "Torrent9" >> /home/$USER/.rss-bridge/whitelist.txt
#RSS update:
php /home/$USER/.rss-bridge/index.php action=display bridge=Torrent9 format=Atom > /home/$USER/.rss-bridge/cache/Torrent9_RSS.xml
#RSS update hourly with cron:
echo "/usr/bin/php /home/$USER/.rss-bridge/index.php action=display bridge=Torrent9 format=Atom > /home/$USER/.rss-bridge/cache/Torrent9_RSS.xml" | sudo tee /etc/cron.hourly/rss_bridge; sudo chmod +x /etc/cron.hourly/rss_bridge
#RSS: /home/$USER/.rss-bridge/cache/Torrent9_RSS.xml
(
Permalink)