News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

RSS Feed Poster

Started by SMFHacks.com Team, January 11, 2007, 07:46:04 PM

Previous topic - Next topic

vbgamer45

Quote from: luuuciano on September 14, 2015, 12:20:49 PM
Images are in the "content" field? and this mod use "description"?
That's what I think it is doing will need to do more tests but seems like it is using description over content:encoded
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

Quote from: JTVaughn on September 14, 2015, 09:08:07 AM
Okay so it pulls from the latest page of the RSS, which seems to be 10 entries for most sites, so when you only select to update 5 at a time, it starts from the 10th and works upwards. That's why it's not starting from the most recent posts. Figured that one out.

But two other issues, which I see others have had:

Using this feedburner http://feeds.feedburner.com/Mzptv you can see the feed has images and full post (instead of excerpt), but the feed poster posts this:



Why isn't it showing the images and the full post? And why doesn't it like line breaks?

Added support for content:encoded in the latest release. That should fix your issue.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

JTVaughn

Almost works. The full post showed up instead of excerpt, so that's great. And the formatting is in tact.

Problem is the images do not load. Seems to be too many tags or something.

Here's what code is generated for the image:

<p><img class="aligncenter size-full wp-image-18047" src="[img]http://www.mzp-tv.co.uk/wp-content/uploads/2015/08/empire3.jpg[/img]" alt="Star Wars - The Empire Strikes Back" width="475" height="150" /></p><br />

JTVaughn

Oh, I had to turn OFF the "Autoembed images from RSS Feeds" setting, and now images work fine.

All looks good :) Only thing it's not doing is centre aligning the images like it does the text

vbgamer45

Ah good to know so that setting gets in the way of html someetimes
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

JTVaughn

Realised the problem with centre aligned images was with my feed, not the mod. Got it working now.

Last thing now, I think :D

The feed poster is posting both the short excerpt AND the full post from Wordpress RSS. The excerpt isn't in the RSS feed, so I don't know where it's scraping it from. Is there something in the code that's grabbing BOTH excerpt and full post, instead of either/or?

You also need an extra space after the topic prefix.

Also, is there a way to take the current topic title when posting in a current topic?

luuuciano

It would be nice an option in rss setup to select which one will use.... excerpt or full content

:-D
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

SMFHacks.com Team

Quote from: luuuciano on September 15, 2015, 09:22:29 AM
It would be nice an option in rss setup to select which one will use.... excerpt or full content

:-D
4.2.1
+Added setting to either use the feed description or the content tag
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

JTVaughn

One little formatting thing. The posts have all got double line spacing. So instead of


Line 1

Line 2

Line 3


It gets turned into


Line 1


Line 2


Line 3



This is because extra <br> tags are added between closing and opening <p> tags, like this:

</p><br /><p>

Is there a way to stop these <br>'s? Is it in your code, or a problem with how SMF formats it?

JTVaughn

Ignore the above, solved in another thread  :P

It was said before a few years ago that there was no way to approve posts before they went live on the forums, is this still true? I tried with an account on post moderation but the post went right through.

margarett

Quote from: JTVaughn on September 21, 2015, 09:19:08 AM
Ignore the above, solved in another thread  :P
For reference: http://www.simplemachines.org/community/index.php?topic=539863.0
(might become handy for anyone else)

About approval, it's just a matter of adding
'approved' => 0,

To $msgOptions, before the call to createTopic (or is it createPost? :P )
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JTVaughn

Quote from: margarett on September 21, 2015, 09:36:18 AM
Quote from: JTVaughn on September 21, 2015, 09:19:08 AM
Ignore the above, solved in another thread  :P
For reference: http://www.simplemachines.org/community/index.php?topic=539863.0
(might become handy for anyone else)

About approval, it's just a matter of adding
'approved' => 0,

To $msgOptions, before the call to createTopic (or is it createPost? :P )

Brilliant, works perfectly, thanks :)

JTVaughn

Seeing as we're on fire now, I have another request :D Probably for margarett, though anyone else can jump in.

When using the "Topic ID (Optional used to add feed to existing topic)" option, is it possible to have the feed poster use the current topic ID title too, instead of using the feed post's title in its place? So for instance, if it were posting in this topic, it would use the current "Re: RSS Feed Poster" title.

margarett

Possible, yes for sure, everything (?) can be coded :P

Disclaimer: not looking at the code so I might be talking trash.
There should be a query already to determine if the topic exists before posting it. If not, it should :P
Either with the existing query or with a new one, it "just" needs to get the topic subject (by JOINing the messages table using the id_first_msg - again, if not already existing), append the default "Re:" prefix and stuff it in the post subject.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JTVaughn

vbgamer will know better, but the only thing I can see in subs-RSS2 is:

$msgOptions = array(
'subject' => $feed['topicprefix'] . $msg_title,

I assume that's saying to make the subject of the post the title of the RSS post, with an optional topic prefix selected in the mod settings, nothing more complicated than that.

vbgamer45

You would use $row['id_topic']  in your subject line to include the topic id in your case.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

JTVaughn

How/where do I add that in? tried replacing $msg_title with it, but that just ends up with (No Subject) for the post

margarett

@vbgamer, he wants to use the topic *subject*, not ID. So if you don't get the $row['subject'], the query itself needs to be edited

* margarett should really get the code in front :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JTVaughn


JTVaughn

Let's put that one on the backburner for the moment.

The next issue I'm seeing is with Wordpress feeds.

The feed poster is grabbing and displaying both the description and the content when posting on the forum, in any scenario. I think this is because Wordpress uses different names for both so that the Wordpress blog owner can set which to use for RSS feeds.

<description><![CDATA[This is the short excerpt version that is a truncated version of the full post]]></description>
<content:encoded><![CDATA[This is the full post blah blah blah]]></content:encoded>

When you feed this through feedburner, and then check the source, you can see the <description> is green, like it's been commented out, and it wont be included. Which is correct. So the feedburner version of the Wordpress RSS displays correctly, but when you grab this using the SMF feed poster, it displays both everything in the <description> AND <content:encoded> tags.

However, with most other blogs/news sites, their RSS only uses one or the other. So you view the source, and everything is in <description> tags, or everything is in <content:encoded> tags, rather than both being in the source.

What's needed is for the feed poster to be aware of both <description> and <content:encoded> being in the source, and knowing when to only grab one or the other, instead of both.

As always, appreciate the help!

Advertisement: