Giter Site home page Giter Site logo

humhub-rss-reader's Introduction

  • πŸ‘‹ Hi, I’m @StevenJoynt
  • πŸ‘€ I’m interested in C++, Arduino, PHP, Yii, HumHub.
  • 🌱 I’m currently learning Git, Laravel, Phaser.

humhub-rss-reader's People

Contributors

archblood avatar stevenjoynt avatar themroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

humhub-rss-reader's Issues

Production ready?

I was wondering if there's a timeline towards making this module 'production ready' I've been using it without issue for ~2months on development sites. I'm now getting ready to move one of those into production. It would be a shame to drop the module.

I wonder if @ArchBlood would be in a position to do a full code audit with a view to helping with this? Or could we get a code audit done elsewhere? Maybe ask in the Humhub community space?

I think this module is great and want to continue using it on my production sites.

Class CActiveForm is removed in HumHub 1.11.*

I get an error when I try to configure the rss module in a space.

The app.log says:
Class 'humhub\compat\CActiveForm' not found in /html/humhub/protected/modules/rss/views/rss/config.php:12

The changelog of humhubn/humhub says:
Enh #4823: Removed CHTML and CActiveForm classes as well as usages (plus refactoring)

@StevenJoynt

Log error with MarkdownHelper on queue/run

Log:

Could not execute queued job! Message: DOMDocument::loadHTML(): Empty string supplied as input Trace:#0 [internal function]: yii\base\ErrorHandler->handleError()
#1 /app/data/modules/rss/components/MarkdownHelper.php(43): DOMDocument->loadHTML()
#2 /app/data/modules/rss/jobs/GetFeedUpdates.php(180): sij\humhub\modules\rss\components\MarkdownHelper::translateHTML()
#3 /app/data/modules/rss/jobs/GetFeedUpdates.php(280): sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsItem()
#4 [internal function]: sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsChannel()
#5 /app/data/modules/rss/components/RssElement.php(54): call_user_func()
#6 /app/data/modules/rss/jobs/GetFeedUpdates.php(326): sij\humhub\modules\rss\components\RssElement->each()
#7 /app/data/modules/rss/jobs/GetFeedUpdates.php(408): sij\humhub\modules\rss\jobs\GetFeedUpdates->parseNewsFeed()
#8 /app/data/modules/rss/jobs/GetFeedUpdates.php(449): sij\humhub\modules\rss\jobs\GetFeedUpdates->downloadNewsFeed()
#9 /app/code/protected/humhub/modules/queue/ActiveJob.php(33): sij\humhub\modules\rss\jobs\GetFeedUpdates->run()
#10 /app/code/protected/vendor/yiisoft/yii2-queue/src/Queue.php(246): humhub\modules\queue\ActiveJob->execute()
#11 /app/code/protected/vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage()
#12 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Queue.php(83): yii\queue\cli\Queue->handleMessage()
#13 [internal function]: yii\queue\db\Queue->yii\queue\db\{closure}()
#14 /app/code/protected/vendor/yiisoft/yii2-queue/src/cli/Queue.php(117): call_user_func()
#15 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Queue.php(93): yii\queue\cli\Queue->runWorker()
#16 /app/code/protected/vendor/yiisoft/yii2-queue/src/drivers/db/Command.php(56): yii\queue\db\Queue->run()
#17 [internal function]: yii\queue\db\Command->actionRun()
#18 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#19 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams()
#20 /app/code/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction()
#21 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction()
#22 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction()
#23 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction()
#24 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest()
#25 /app/code/protected/yii(29): yii\base\Application->run()
#26 {main}

Maybe just at the beginning of the translateHTML method we should add:

        if (!$html) {
            return '';
        }

Small Tips

Looking through your MarkdownHelper.php I see that you're using MarkdownHelper::, it is better to just use self:: if you're using the class from the same file, I would also like to note that you aren't required to use $ statement to request $article, $level and etc. just use self::article, self::level and etc.

Problems with HTML A tags

HTML A tags that enclose an image and text need to be applied separately in markdown syntax

In HTML (from the RSS feed data) we sometimes see:
<a href="http://example.com/page.html"> <img src="http//example.com/image.jpg"> some text </a>

This needs to be converted to MarkDown for a HumHub Post like this:
[![](http//example.com/image.jpg)](http//example.com/page.html) [some text](http//example.com/page.html)

Update to Humhub 1.14.2 and RSS stopped working

Update Humhub to version 1.14.2 and these errors occurred.

I reinstalled RSS and still the same. Not sure how to proceed. Here is log. Thanks. Any help is greatly appreciated.
Vinn

  1. in /var/www/humhub/protected/vendor/yiisoft/yii2/base/Component.php

line 291 */
public function __call($name, $params)
{
$this->ensureBehaviors();
foreach ($this->_behaviors as $object) {
if ($object->hasMethod($name)) {
return call_user_func_array([$object, $name], $params);
}
}
throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}

    /**
     * This method is called after the object is created by cloning an existing one.
     * It removes all behaviors because they are attached to the old object.
     */
    public function __clone()
    {

line 309 $this->_events = [];

2. in /var/www/humhub/protected/humhub/modules/rss/controllers/RssController.php at line 23 – yii\base\Component::__call()
17181920212223242526272829

line 17 * Configuration Action for Space Admins
*/
public function actionConfig()
{
$container = $this->contentContainer;
$form = new ConfigureForm();
$form->url = $container->getSetting('url', 'rss');
$form->article = $container->getSetting('article', 'rss', 'summary');
$form->pictures = $container->getSetting('pictures', 'rss', 'yes');
$form->maxwidth = $container->getSetting('maxwidth', 'rss', '500');
$form->maxheight = $container->getSetting('maxheight', 'rss', '500');
$form->interval = $container->getSetting('interval', 'rss', '60');
line 29 $form->owner = RssController::vetOwner($container->getSetting('owner', 'rss', ''), $container)->guid;

3. sij\humhub\modules\rss\controllers\RssController::actionConfig()
4. in /var/www/humhub/protected/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array()
5. in /var/www/humhub/protected/vendor/yiisoft/yii2/base/Controller.php at line 178 – yii\base\InlineAction::runWithParams()
6. in /var/www/humhub/protected/vendor/yiisoft/yii2/base/Module.php at line 552 – yii\base\Controller::runAction()
7. in /var/www/humhub/protected/vendor/yiisoft/yii2/web/Application.php at line 103 – yii\base\Module::runAction()
8. in /var/www/humhub/protected/vendor/yiisoft/yii2/base/Application.php at line 384 – yii\web\Application::handleRequest()
9. in /var/www/humhub/index.php at line 25 – yii\base\Application::run()
19202122232425

    require(__DIR__ . '/protected/humhub/config/web.php'),
    (is_readable(__DIR__ . '/protected/config/dynamic.php')) ? require(__DIR__ . '/protected/config/dynamic.php') : [],
    require(__DIR__ . '/protected/config/common.php'),
    require(__DIR__ . '/protected/config/web.php')
);
 
(new humhub\components\Application($config))->run();

$_GET = [
'r' => 'rss/rss/config',
'cguid' => 'dc70ccff-fb83-4cb1-b6fb-eb0eeb8b6a43',
];

$_COOKIE = [
'PHPSESSID' => '9vtkrg4a8bhe9an4mht3nnua0r',
'_csrf' => '35aff18e91de92b07af9c6bfd1be9ffb071936c168c074c8bd4c98087e94304aa:2:{i:0;s:5:"_csrf";i:1;s:32:"bP7piJdAW45avuzLkr1SFjqb3slort_n";}',
'_identity' => '3da977c7c1a19539cebcc63404a40dc146f61a0330c85268303378b4d2773a33a:2:{i:0;s:9:"_identity";i:1;s:50:"[5,"67cb3726-0e63-4e67-9771-a2ca02561eac",2592000]";}',
];

$_SESSION = [
'__flash' => [],
'__id' => 5,
'__authKey' => '67cb3726-0e63-4e67-9771-a2ca02561eac',
'__expire' => 1688323049,
'currentAuthClientId' => 'local',
'user.canSeeAdminSection' => true,
];

Yii Framework

2023-07-02, 14:14:09

nginx/1.22.0

Yii Framework/2.0.48-dev

Error after activating module in space and clicking on configure

Hi,
I love this humhub module!
However, after activating the module as an admin and activating it in a space, I clicked on configure, and an error came up saying:

"Oooops... It looks like you may have taken the wrong turn.
An internal server error occurred."

Maybe this error in logging can help you:

yii\base\UnknownMethodException: Calling unknown method: humhub\modules\space\models\Space::getSetting() in /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /homepages/12/d855780101/htdocs/hub/protected/modules/RSS/controllers/RssController.php(23): yii\base\Component->__call('getSetting', Array)
#1 [internal function]: sij\humhub\modules\rss\controllers\RssController->actionConfig()
#2 /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('config', Array)
#5 /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('rss/rss/config', Array)
#6 /homepages/12/d855780101/htdocs/hub/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest(Object(humhub\components\Request))
#7 /homepages/12/d855780101/htdocs/hub/index.php(26): yii\base\Application->run()
#8 {main}

I'm not quite sure if my HumHub version is the problem. I'm using HumHumb v1.13.1
Thanks a lot.

Problem with order of HTML tags

<strong><em>text</em></strong> works ok
<em><strong>heading</strong>text</em> does not work
Both appear to be translated correctly, but the HumHub MarkDown interpreter does not like the second example
It shows as **heading**text in italics, but not bold

Detect if SimpleXML module is installed

Display a helpful message if the SimpleXML module is not installed, rather than throwing a cryptic log message to confuse the administrator.
The SimpleXML module is not required by the rest of HumHub, so it isn't shown on the prerequisites tab of the administrators information page.

Generates duplicate Posts in Stream

Need to use pubDate from RSS to set the date of the Post. Then we can use that to build a database query to find out if the Post is already in the Stream.
Add a config option to update the Post or just keep the original version of the News Item. Default to update the Post.

Post items do not sort correctly

Database columns updated_at and stream_sort_date are supplied by this module, but overridden by the Yii and humhub framework to be the current timestamp.
May need to run an additional query to frig these values after inserting or updating the post and content tables.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.