SMBC updated the feed to not have the comic, here have it back.
https://github.com/randompherret/Tiny-T ... s_smbc.php
Saturday Morning Breakfast Cereal feed change
-
- Bear Rating Trainee
- Posts: 36
- Joined: 04 Jul 2013, 08:11
Re: Saturday Morning Breakfast Cereal feed change
404-ing. Is this project dead?
-
- Bear Rating Trainee
- Posts: 36
- Joined: 04 Jul 2013, 08:11
Re: Saturday Morning Breakfast Cereal feed change
Just cleaned up my github, I didn't realize I had ever posted it. With the changes to the feed from today I have updated it.
save to /ttrss/plugins/af_comics/filters/af_comics_smbc.php
/e code bad
save to /ttrss/plugins/af_comics/filters/af_comics_smbc.php
/e code bad
Last edited by randompherret on 27 Jun 2016, 18:59, edited 1 time in total.
Re: Saturday Morning Breakfast Cereal feed change
Maybe I'm doing something wrong, but PHP complains about parse error:
Parse error: syntax error, unexpected '$' in /../af_comics/filters/af_comics_smbc.php on line 20
Parse error: syntax error, unexpected '$' in /../af_comics/filters/af_comics_smbc.php on line 20
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: Saturday Morning Breakfast Cereal feed change
probably should be ->item(0), a typo
Re: Saturday Morning Breakfast Cereal feed change
Yeah, I guessed that, but then it complained about something else, and I didn't have time to investigate.
e: missed semicolon, duh. ->item(0);
e: missed semicolon, duh. ->item(0);
-
- Bear Rating Trainee
- Posts: 36
- Joined: 04 Jul 2013, 08:11
Re: Saturday Morning Breakfast Cereal feed change
Strange, must have been a copy /paste issue as it is correct on my live system. Corrected here.
Code: Select all
<?php
class Af_Comics_Smbc extends Af_ComicFilter {
function supported() {
return array("Saturday Morning Breakfast Cereal");
}
function process(&$article) {
$owner_uid = $article["owner_uid"];
if (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) {
$doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"]));
$basenode = false;
if ($doc) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//img[@id="cc-comic"])')->item(0);
if ($basenode) {
$article["content"] = $doc->saveXML($basenode);
}
}
return true;
}
return false;
}
}
?>
Re: Saturday Morning Breakfast Cereal feed change
Thank you, and thanks for posting the plugin, too.
Return to “Themes and plugins”
Who is online
Users browsing this forum: No registered users and 1 guest