init
This commit is contained in:
0
standalone/rssbinsearch/bl_desc
Normal file
0
standalone/rssbinsearch/bl_desc
Normal file
3
standalone/rssbinsearch/bl_title
Normal file
3
standalone/rssbinsearch/bl_title
Normal file
@@ -0,0 +1,3 @@
|
||||
german
|
||||
xxx
|
||||
pr0n
|
||||
119
standalone/rssbinsearch/rssbinsearch.php
Executable file
119
standalone/rssbinsearch/rssbinsearch.php
Executable file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
//Anti Spam List
|
||||
$sMovieList = '';
|
||||
if(file_exist('movie_list')) $sMovieList = file_get_contents('movie_list');
|
||||
if(substr($sMovieList, 0, 8) != date('Ymd')) file_put_contents('movie_list', '');
|
||||
$asMovieList = array_shift(explode("\n", $sMovieList));
|
||||
|
||||
//Black List
|
||||
$sBlTitleContent = file_get_contents('bl_title');
|
||||
$sBlDescContent = file_get_contents('bl_desc');
|
||||
$asBlTitle = explode("\n", $sBlTitleContent);
|
||||
$asBlDesc = explode("\n", $sBlTitleContent);
|
||||
|
||||
$asChannels = array('alt.binaries.hdtv.x264', 'alt.binaries.movies', 'alt.binaries.sleazemovies');
|
||||
foreach($asChannels as $iChanKey=>$sChannel)
|
||||
{
|
||||
//Extract file
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://rss.binsearch.net/rss.php?max=300&g='.$sChannel);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
|
||||
$sRssIn = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
//Rss Feed Input
|
||||
$sRssIn = str_replace("\n", '', $sRssIn);
|
||||
|
||||
//Rss Feed Output
|
||||
$sRssOut = '';
|
||||
|
||||
//Slice Rss feed into items
|
||||
preg_match_all("/\<item\>(.+)\<\/item\>/U", $sRssIn, $asItems);
|
||||
//print_r($asItems);die();
|
||||
foreach($asItems[1] as $iItemKey=>$sItem)
|
||||
{
|
||||
//Slice item into tags
|
||||
preg_match_all("/\<(?P<tag>\w+)\>(?P<text>.+)\<\/(?P<tag_fin>\w+)\>/U", $sItem, $asTags);
|
||||
//print_r($asTags);die();
|
||||
/*
|
||||
[0] => Array
|
||||
(
|
||||
[0] => <title>dc96773fb88f2f75d581194a4320fedc[76/79] - "15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f.0" yEnc (1/1)</title>
|
||||
[1] => <description><table border width="75%" style="border: solid 1px"><tr><td width="25%">Group:<td>alt.binaries.hdtv.x264<tr><td>Subject:<td>dc96773fb88f2f75d581194a4320fedc[76/79] - "15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f.0" yEnc (1/1)<tr><td>Poster:<td>Yenc@power-post.org (Yenc-PP-A&amp;A)<tr><td>Details:<td><span class="d"><br><a href="http://www.binsearch.info/?b=15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f&amp;g=alt.binaries.hdtv.x264&amp;p=Yenc%40power-post.org+%28Yenc-PP-A%26A%29&amp;max=250">collection</a> size: 2.35&nbsp;MB, parts available: 7 / 7<br>- 2 par2 files<br>- 1 split file<br>- 1 other file<br></span></table></description>
|
||||
[2] => <pubDate>Thu, 03 Jan 2013 15:31:53 GMT</pubDate>
|
||||
[3] => <link>http://www.binsearch.info/?action=nzb&97515747=1</link>
|
||||
)
|
||||
|
||||
[tag] => Array
|
||||
(
|
||||
[0] => title
|
||||
[1] => description
|
||||
[2] => pubDate
|
||||
[3] => link
|
||||
)
|
||||
|
||||
[text] => Array
|
||||
(
|
||||
[0] => dc96773fb88f2f75d581194a4320fedc[76/79] - "15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f.0" yEnc (1/1)
|
||||
[1] => <table border width="75%" style="border: solid 1px"><tr><td width="25%">Group:<td>alt.binaries.hdtv.x264<tr><td>Subject:<td>dc96773fb88f2f75d581194a4320fedc[76/79] - "15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f.0" yEnc (1/1)<tr><td>Poster:<td>Yenc@power-post.org (Yenc-PP-A&amp;A)<tr><td>Details:<td><span class="d"><br><a href="http://www.binsearch.info/?b=15321568f277a26d326baddfb33d62621fe93693187c474f8cac0fb13a0d5b8f&amp;g=alt.binaries.hdtv.x264&amp;p=Yenc%40power-post.org+%28Yenc-PP-A%26A%29&amp;max=250">collection</a> size: 2.35&nbsp;MB, parts available: 7 / 7<br>- 2 par2 files<br>- 1 split file<br>- 1 other file<br></span></table>
|
||||
[2] => Thu, 03 Jan 2013 15:31:53 GMT
|
||||
[3] => http://www.binsearch.info/?action=nzb&97515747=1
|
||||
*/
|
||||
|
||||
//Extract item's tag names
|
||||
foreach($asTags['tag'] as $iTagKey=>$sTageName)
|
||||
{
|
||||
$asTagIndex[$sTageName] = $iTagKey;
|
||||
}
|
||||
$sTitle = $asTags['text'][$asTagIndex['title']];
|
||||
$sDesc = $asTags['text'][$asTagIndex['description']];
|
||||
|
||||
//Validator
|
||||
$bValid = true;
|
||||
|
||||
//Check Poster
|
||||
//preg_match('/Poster\:\<\;td\>\;(?P<address>\S*)\ \((?P<user>\S*)\)/i', $sTitle, $as);
|
||||
foreach($asBlTitle as $sBlWord)
|
||||
{
|
||||
preg_match('/'.preg_quote($sBlWord).'/i', $sTitle, $asFoundBlWord);
|
||||
if(count($asFoundBlWord) != 0) $bValid = false;
|
||||
}
|
||||
|
||||
foreach($asBlDesc as $sBlWord)
|
||||
{
|
||||
preg_match('/'.preg_quote($sBlWord).'/i', $sDesc, $asFoundBlWord);
|
||||
if(count($asFoundBlWord) != 0) $bValid = false;
|
||||
}
|
||||
|
||||
//Check movie quality
|
||||
preg_match('/1080p/i', $sTitle, $asQuality);
|
||||
if(count($asQuality) == 0) $bValid = false;
|
||||
|
||||
//Jul - Remove German movies
|
||||
//preg_match('/german/i', $sTitle, $asLang);
|
||||
//if(count($asLang) != 0) $bValid = false;
|
||||
|
||||
//Check Series
|
||||
preg_match('/s([0-9]{1,2})e([0-9]{2})/i', $sTitle, $asSeries);
|
||||
if(count($asSeries) != 0) $bValid = false;
|
||||
|
||||
if($bValid) $asValidItems[] = $asItems[0][$iItemKey];
|
||||
}
|
||||
}
|
||||
|
||||
//rebuild RSS feed
|
||||
date_default_timezone_set('Europe/Paris');
|
||||
echo '<?xml version="1.0" encoding="utf-8"?><rss version="2.0">'.
|
||||
'<channel>'.
|
||||
'<title>'.implode(', ', $asChannels).'</title>'.
|
||||
'<link>http://www.binsearch.info/</link>'.
|
||||
'<description>Latest newsgroup posts as indexed by BinSearch.info</description>'.
|
||||
'<copyright>This RSS collection is copyright (c) BinSearch team. Commercial use prohibited. This collection is generated by an automated process based on the posts found in global Usenet newsgroups. The posters retain copyright over their individual posts.</copyright>'.
|
||||
'<lastBuildDate>'.date('r').'</lastBuildDate>'.
|
||||
implode("\n\t\t", $asValidItems).
|
||||
'</channel>'.
|
||||
'</rss>';
|
||||
?>
|
||||
Reference in New Issue
Block a user