Keyword

Change RSS feed output

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
5 years 6 months ago #173237 by Uzi
Change RSS feed output was created by Uzi
Hello,

Is it possible to change the RSS feed output? I am trying to get it working in a certain environment but the feed output needs to be changed. Instead of putting the items in a items field, I want it to directly output the items in the channel.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #173240 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
K2 uses Joomla's feed parser, which means you can get ?format=feed&type=rss or ?format=feed&type=atom.

If these don't fit what you need, I recommend you grab the json output ?format=json, json_decode it and then do whatever you want with the data. Much better imho.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
5 years 6 months ago - 5 years 6 months ago #173256 by Uzi
Replied by Uzi on topic Change RSS feed output
Ok thanks. Isn't there a way to override the RSS feed, because it's exactly what I need, but I need to remove one parent entry so it gets loaded in correctly in my third party app.

EDIT: Also the ?format=json doesn't load. It just keeps spinning, but it never shows something. You sure that is the right call?
Last edit: 5 years 6 months ago by Uzi.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #173318 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
You can't override how RSS/Atom are produced without modifying core K2 views.

As for JSON, it works just fine, e.g.: getk2.org/blog?format=json

That view is available for categories/tags/users (any itemlist) and items only. Perhaps you were testing a different view (e.g. "latest from X").

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago - 5 years 5 months ago #173471 by agan E
Replied by agan E on topic Change RSS feed output
Hi Fotis,
I'm getting only few lines of description only. i like to get full posts in rss feed (xml url). can you help on this.
Last edit: 5 years 5 months ago by agan E. Reason: to add few more details like format and out put type.

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #173472 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
Just enable full-text inclusion for feeds in the "Content" tab under the K2 settings.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago - 5 years 5 months ago #173477 by agan E
Replied by agan E on topic Change RSS feed output
Hi Fotis,

First of all, Thanks for the quick reply. While i'm checking the k2 settings under "Content" tab full-text inclusion already enabled and i guessed the actually problem. I set "Item Introtext word limit" to "15" once i removed that i'm getting full description in my rss url.

Thanks for the tip. [It help me to where to look. ]

By
Agan
Last edit: 5 years 5 months ago by agan E. Reason: grammar correction

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #173481 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
Great :)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
5 years 17 hours ago #175475 by Uzi
Replied by Uzi on topic Change RSS feed output
Hello,

Back again because I decided to just hack the core if there isn't a user friendly solution available. Can you point me in what file I need to be to change the RSS output?

Please Log in or Create an account to join the conversation.

More
5 years 9 hours ago #175481 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
That would be Joomla. I don't recommend so.

Why not use ?format=json in K2 URLs and simply grab ALL the data that K2 outputs? Much better compared to RSS/Atom feeds.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Uzi
  • Uzi's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 11 months ago - 4 years 11 months ago #175485 by Uzi
Replied by Uzi on topic Change RSS feed output
Because I need to insert an RSS feed to the third party application. So i have 2 options here, judiging by your coment:

1. I override the RSS feed output system of Joomla (via a plugin or just a core hack)
2. I use the format json output and convert that to a RSS feed

I think going with option 1 is better because that is just way faster for me. I just want to know where i can change the output of the existing output.

EDIT: OK i foudn the file in libraries/src/Document, but I don't see how K2 fits into that. How can I for example change how the image is loaded?
Last edit: 4 years 11 months ago by Uzi.

Please Log in or Create an account to join the conversation.

More
4 years 11 months ago #175486 by JoomlaWorks
Replied by JoomlaWorks on topic Change RSS feed output
Don't hack core files.

Additionally, the RSS feed does not offer the content flexibility of JSON.

Instead do this simple thing.

Grab the JSON output that K2 provides, process it in a standalone PHP file, outside of Joomla, and simply produce a new RSS or Atom feed. Then use this "bridge" file's feed output to to serve the feed to your third party app.

Reading the JSON file is a piece of cake with file_get_contents and then json_decode. You'll get an object which you can then transform to whatever you like. Which do you think is easier? This option or hacking the RSS/Atom driver in Joomla?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum