Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-09-02 02:07:45

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

A favorite RSS reader pulling in site content?

I have a link list url shortener with a php script to generate a feed of the 20 most recent shortened urls. The feed is basic and ugly but I want my whizbang site to print that content either in pieces here and there or lumped as 10 or 20 (php script defaults to 20) as an aside.

I’m getting slowly to the part where I tinker with format, font and fun things but this RSS question is strictly for function at the moment. Back in the day, I had to use some Google thing with a special generated key on an html website to display RSS on a scrolling marquee. It’s not still like that, is it?

If you’re into more details, the YOURLS RSS plugin spits this:
https://sbce.us Latest links on https://sbce.us YOURLS v1.7.2 en https://snakebite.cafe/defuse-diffuse-rancor-and-trouble Sun, 02 Sep 2018 00:58:18 +0000 https://sbce.us/pb1wa https://sbce.us/pb1wa https://www.npr.org/2018/09/01/643909884/california-lawmakers-pass-net-neutrality-bill Sun, 02 Sep 2018 00:57:57 +0000 https://sbce.us/c0yki https://sbce.us/c0yki https://www.destructoid.com/insomniac-s-stormland-nails-its-vr-feel-520809.phtml Sun, 02 Sep 2018 00:51:15 +0000

From php that looks like this:

<item>
	<title><?php echo yourls_esc_html( $item['title'] ); ?></title>
	<description><?php echo htmlentities( $item['url'] ); ?></description>
	<pubDate><?php echo date('D, d M Y H:i:s O', strtotime($item['timestamp']) ); ?></pubDate>  
	<link><?php echo $item['shorturl']; ?></link>  
	<guid isPermaLink="false"><?php echo $item['shorturl']; ?></guid>
</item>

I’m still wrestling with YOURLS to make it private to avoid the spammers who seem to automate their hijacking.


Voice Actor – starting up a site for that good book stuff.

Offline

#2 2018-09-02 04:05:31

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: A favorite RSS reader pulling in site content?

Snooping led me to more specifics,
  • bit_rss – bit_rss is a SimplePie-based port of the tcm_rss plugin for Textpattern that used MagpieRSS.
  • SimplePie Plugin for Textpattern – An intentionally simple plugin that displays feed items as a list. Allows for a small amount of customization.
  • mka_simplepie – mka_simplepie – Embed RSS-Feeds with SimplePie.

Any user stories or reviews. Midnight for me so my research today is coming to an end.


Voice Actor – starting up a site for that good book stuff.

Offline

#3 2018-09-02 07:27:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: A favorite RSS reader pulling in site content?

I’m not sure whether any of those are still up to date, and if I recall correctly, you need to upload additional scripts for them.

But both smd_xml and etc_query can import rss feeds and output its contents according to a form of your choosing. Both are a bit more general purpose, so require a bit of study to get your head around them.

BTW: I use YOURLS privately too. There’s a switch to make it private described here.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2018-09-02 20:46:17

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: A favorite RSS reader pulling in site content?

smd_xml I think. That’s just hard enough and reads to have all the control I could hope for.

I found the php in what makes the RSS doesn’t put the correct Title in the raw feed. I’ll bang on that a little and then move on to that feed reader plugin. Thank you!

(You can see in the php code in the first post:
  • title, url, time, shorturl
but what comes back in the raw unformatted feed is:
  • url, time, shorturl and shorturl a second time.) I doubt I’ll solve that! This is fun but way outside my wheelhouse!

Voice Actor – starting up a site for that good book stuff.

Offline

#5 2018-09-02 21:39:21

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: A favorite RSS reader pulling in site content?

Take a look at the page source, or use a browser like chrome or firefox that shows you the xml structure. That should show you what bits you want to access.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2018-09-03 02:29:17

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: A favorite RSS reader pulling in site content?

It worked out well! Mobile Chrome’s way of displaying the XML output was fishy – turned out to be just fine and really easy too. Limiting characters would be a treat but I’ll take what I can get!

Back to something you said though, is SimplePie really that far out of development? I recall everyone being so excited about its strengths when it came around.


Voice Actor – starting up a site for that good book stuff.

Offline

#7 2018-09-03 06:40:04

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: A favorite RSS reader pulling in site content?

BryanA. wrote #313778:

It worked out well! Mobile Chrome’s way of displaying the XML output was fishy – turned out to be just fine and really easy too. Limiting characters would be a treat but I’ll take what I can get!

Glad you got it working :-) If you want to control the length of output, you can use smd_wrap and the transform="cut|150c|25w|…" attribute to chop the length of an item down to 150 characters, 25 words and add a trailing ‘…’ If you have tags in that output, you might want to additionally use strip_tags first – see the example in the docs.

Back to something you said though, is SimplePie really that far out of development? I recall everyone being so excited about its strengths when it came around.

Sorry, I was referring to the txp plugins that bring in SimplePie. They may still work but I don’t think any of them are being actively maintained. The last time I looked, SimplePie itself had some problems with PHP7 and the library had been split up into numerous smaller files so the txp plugins needed some manual changes anyway.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB