Skip to content

Commit

Permalink
Add api_version (for upcoming tt-rss 1.7.9) and fix utf8 encoding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
André Glüpker committed Apr 22, 2013
1 parent 7d95910 commit 56804e9
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 30 deletions.
6 changes: 5 additions & 1 deletion af_beetlebum/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Beetlebum extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Display Beetlebum comic directly in feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_betweenfailures/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_BetweenFailures extends Plugin {
private $host;

function about() {
return array(1.1,
return array(1.2,
"Display Between Failures comic directly in feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_cad/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_CAD extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Display CTRL+ALT+DEL comic directly in feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_darklegacy/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_DarkLegacy extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Display Dark Legacy Comic directly in feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
8 changes: 6 additions & 2 deletions af_daujones/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_DAUJones extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete DAUJones story into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "daujones,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
10 changes: 6 additions & 4 deletions af_foebud/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_FoeBuD extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete FoeBuD article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,9 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "foebud,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
$html = fetch_file_contents($article["link"]);
$html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8");
@$doc->loadHTML($html);
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_golem/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Golem extends Plugin {
private $host;

function about() {
return array(1.1,
return array(1.2,
"Load complete golem article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "golem,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_gulli/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Gulli extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete gulli article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "gulli,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_heise/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Heise extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete heise article into feed",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "heise,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
6 changes: 5 additions & 1 deletion af_nerfnow/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_NerfNow extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Bigger inline image for NerfNow",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_nichtlustig/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_NichtLustig extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Remove unnecessary stuff from Nicht Lustig feed",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_raumfahrer/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Raumfahrer extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete raumfahrer.net article into feed",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_ssdebian/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_SSDebian extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load screenshots into debian screenshots feed",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
6 changes: 5 additions & 1 deletion af_stuttmann/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Stuttmann extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Bigger inline images for the stuttmann caricature feed",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand Down
8 changes: 6 additions & 2 deletions af_taz/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_taz extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete taz article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "taz,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_titanic/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_Titanic extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete Titanic article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "titanic,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_userfriendly/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_UserFriendly extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load User Friendly comic into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "userfriendly,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
@$doc->loadHTML('<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]));
@$doc->loadHTML(mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8"));

$basenode = false;

Expand Down
8 changes: 6 additions & 2 deletions af_winfuture/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ class Af_WinFuture extends Plugin {
private $host;

function about() {
return array(1.0,
return array(1.1,
"Load complete winfuture article into feed.",
"Joschasa");
}

function api_version() {
return 2;
}

function init($host) {
$this->link = $host->get_link();
$this->host = $host;
Expand All @@ -24,7 +28,7 @@ function hook_article_filter($article) {
if (strpos($article["plugin_data"], "winfuture,$owner_uid:") === FALSE) {

$doc = new DOMDocument();
$html = '<?xml encoding="UTF-8">'.fetch_file_contents($article["link"]);
$html = mb_convert_encoding(fetch_file_contents($article["link"]), 'HTML-ENTITIES', "UTF-8");
$html = preg_replace("/(<[\ ]*br[\/\ ]*>){2}/", "<br />", $html); // remove double linebreaks
@$doc->loadHTML($html);

Expand Down
Loading

0 comments on commit 56804e9

Please sign in to comment.