[CDB] Feed post bot

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Locked
User avatar
canonknipser
Registered User
Posts: 1515
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.2][RC] Feed post bot

Post by canonknipser » Tue Jan 09, 2018 10:20 am

Ger wrote:
Mon Jan 08, 2018 3:01 pm
Changed both in the latest version on github
Thanks :)

The german translation from a previous post in this topic had not the correct folder name, because it was written the formal version of german language and therefore it should be in a folder de-x-sie instead of de. I used that file as a base to create /correct both language versions.

Please see this link for the german translation files de.zip (german casual) and de-x-sie.zip (german formal).
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Tue Jan 09, 2018 11:14 am

canonknipser wrote:
Tue Jan 09, 2018 10:20 am
Ger wrote:
Mon Jan 08, 2018 3:01 pm
Changed both in the latest version on github
Thanks :)

The german translation from a previous post in this topic had not the correct folder name, because it was written the formal version of german language and therefore it should be in a folder de-x-sie instead of de. I used that file as a base to create /correct both language versions.

Please see this link for the german translation files de.zip (german casual) and de-x-sie.zip (german formal).
Thanks, updated the TS.
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
canonknipser
Registered User
Posts: 1515
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.2][RC] Feed post bot

Post by canonknipser » Tue Jan 09, 2018 2:51 pm

Ger, any chance to reduce the entries in the admin log? Just recognized today, that for every feed fetch (even when it has no new data) a new entry in the log is written.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Tue Jan 09, 2018 3:25 pm

canonknipser wrote:
Tue Jan 09, 2018 2:51 pm
Ger, any chance to reduce the entries in the admin log? Just recognized today, that for every feed fetch (even when it has no new data) a new entry in the log is written.
That's on purpose, since many people wonder why no new items are posted. It depends on the cron (phpBB cron isn't like system cron) and whether or not there are any new items to post. This logging ensures the admin that the process has run properly.

You can of course choose to comment or remove the 3 occurrences of this line in ./ger/feedpostbot/classes/driver.php:

Code: Select all

$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'FPB_LOG_FEED_FETCHED', time(), array($url));
I very much want this logging to happen since it clarifies a lot for the admin who use this extension.
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
canonknipser
Registered User
Posts: 1515
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.2][RC] Feed post bot

Post by canonknipser » Tue Jan 09, 2018 7:19 pm

Ger wrote:
Tue Jan 09, 2018 3:25 pm
That's on purpose, ... This logging ensures the admin that the process has run properly.
I agree, it's useful for a admin to have a confirmation that the processes run properly.

But, using the default of 1800 seconds (=30 minutes) as processing interval, there are approx. 50 messages every day for every feed. And, what I also recognized: when a cron run was missing because no user was active on board, on the next cron run the same feed is fetched multiple times (yes I know about the limitations of phpBBs cron system ;) )
Currently, on my test board I'm running your extension with 3 feeds enabled, so there are nearly 150 messages every day, which makes it hard to filter out other admin actions (looked today for the log entries of the last upgrade just a few days ago, found them 35 pages back) or real problems.

Sure, I can disable those lines in your extension. But I would suggest a acp switch ("Log also successful feed fetches") to make it customisable.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
Stoker 4.0
Registered User
Posts: 1478
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: [3.2][RC] Feed post bot

Post by Stoker 4.0 » Sun Jan 14, 2018 4:54 pm

Thanks for a great EXT.
I have been testing it with feed links like this: https://www.phpbb.com/community/feed/forum/616 and it doesnt work with any of the feed types.
Also when there is a line space in the feed, there is posted 3 line spaces in the topic.

This:

Code: Select all

We are pleased to announce the release of phpBB 3.2.2 "Bertie’s New Year Resolution". This version is a maintenance & security release of the 3.2.x branch which fixes one security issue, adds one minor feature addition, as well as fixing various issues reported in previous versions.

Previous versions did not limit the allowed schemes for URLs in profile fields and therefore allowed users to also specify URLs with the javascript scheme. This is now forbidden. As always, please keep in mind that external URLs can potentially be unsafe. Therefore it is recommended to not click on any URLs that might look suspicious to you. We would like to thank “aaaimg” for the disclosure of this issue to our development team.
is posted like this:

Code: Select all

We are pleased to announce the release of phpBB 3.2.2 "Bertie’s New Year Resolution". This version is a maintenance & security release of the 3.2.x branch which fixes one security issue, adds one minor feature addition, as well as fixing various issues reported in previous versions.



Previous versions did not limit the allowed schemes for URLs in profile fields and therefore allowed users to also specify URLs with the javascript scheme. This is now forbidden. As always, please keep in mind that external URLs can potentially be unsafe. Therefore it is recommended to not click on any URLs that might look suspicious to you. We would like to thank “aaaimg” for the disclosure of this issue to our development team.

EDIT: Sorry about that. The feed is posted just fine. There was a delay :D

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Mon Jan 15, 2018 7:53 am

Stoker 4.0 wrote:
Sun Jan 14, 2018 4:54 pm
Also when there is a line space in the feed, there is posted 3 line spaces in the topic.
Yeah, that's because they apply newlines (\n) together with linebreaks (<br>). Feedpostbot translates those linebreaks to newlines and all the newlines are translated to linebreaks again by phpBB when posting.

But since there are thousands of feeds to deal with, I need to translate those linebreaks.
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

Mesto
Registered User
Posts: 36
Joined: Mon Jul 27, 2009 12:29 am

Re: [3.2][RC] Feed post bot

Post by Mesto » Thu Jan 25, 2018 10:32 pm

German translation for 1.0.7.
https://workupload.com/file/9JAFn52

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Fri Jan 26, 2018 8:38 am

Mesto wrote:
Thu Jan 25, 2018 10:32 pm
German translation for 1.0.7.
https://workupload.com/file/9JAFn52
Thanks!
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
canonknipser
Registered User
Posts: 1515
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.2][RC] Feed post bot

Post by canonknipser » Fri Jan 26, 2018 8:57 am

Mesto wrote:
Thu Jan 25, 2018 10:32 pm
German translation for 1.0.7
As last time, that translation is not de (german casual, as the folders are named), but de-x-sie (german formal).
See: posting.php?mode=reply&f=456&t=2411596#pr14903896 for both language variants
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Fri Jan 26, 2018 9:47 am

canonknipser wrote:
Tue Jan 09, 2018 7:19 pm
Sure, I can disable those lines in your extension. But I would suggest a acp switch ("Log also successful feed fetches") to make it customisable.
I noticed I didn't respond this this yet... My apologies.

As with other (literally dozens) of suggestions: it's a good one, but I won't implement it just now. I want to focus on getting the current functionality stable and then validated. The extension already got bigger and bigger over time so I really want to focus on getting the essentials straight.
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

zorni
Registered User
Posts: 116
Joined: Mon Mar 23, 2009 10:29 pm
Contact:

Re: [3.2][RC] Feed post bot

Post by zorni » Fri Feb 02, 2018 6:10 pm

Hey Ger,

I've a little Issue with a blog.

The Text right beside an image doesn't look very good, example:
Image

It should look like this I think:
Image

So, is it possible to add 2 blank Lines after the closing [/img] tag?

User avatar
Ger
Recognised Extension Developer
Posts: 1474
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][RC] Feed post bot

Post by Ger » Mon Feb 05, 2018 8:47 am

Not sure about this actually...

Let me explain: It comes down to the fact that the feed source probably floats (aligns) the image to the left or right, making the text wrap nicely around the image. However: this kind of markup isn't default available on phpBB, one would have to use the advanced BBcode extension or manually add the required BBcodes for it. Since there is no way for the BBcode to know if and then how a forum this has implemented. Therefore I have no other sane choice than to strip all that kind of formatting and replace it with a simple img BBcode.

That works fine for most content, however it might be that a feed has the image in 1 line with text content, either before (like your example) or after the text. Or maybe somewhere in the middle. Some have breaks before or after them, some don't.

Now the most simple solution might be to change this line to:

Code: Select all

"/\<img(.*?) src=\"(.*?)\"(.*?)\>/is" => "\n[img]$2[/img]\n",
You can safely apply this at your board if you want to.

However, this might again lead multiple blank lines following each other up. I could of course replace multiple blank lines (say 3) to 1 or 2 but sometimes that is just not what's intended.

So yeah, basically I haven't found a solid solution for this. The main problem is that I simply cannot foresee all the feeds in the world ;)
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

zorni
Registered User
Posts: 116
Joined: Mon Mar 23, 2009 10:29 pm
Contact:

Re: [3.2][RC] Feed post bot

Post by zorni » Mon Feb 05, 2018 10:23 am

Thanks Ger, that solution works fine!

User avatar
BadBlock
Registered User
Posts: 80
Joined: Sat Oct 06, 2001 8:33 pm

Re: [3.2][RC] Feed post bot

Post by BadBlock » Tue Feb 13, 2018 12:53 am

Nice mod!
Are there any plans to add a feature to post feed(s) to a specific topic, rather than forum?
Just a simple topic_id text field against each feed and a dropdown selector to choose between "post to forum" and "reply to topic".
That would be really great.

Locked

Return to “Extensions in Development”

Who is online

Users browsing this forum: Hartenheer, jackennils and 27 guests