Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#121 2010-10-13 09:40:59
- naoj77
- Member
- From: Barcelona, Catalunya
- Registered: 2007-01-19
- Posts: 15
Re: aks_rss : RSS parser and aggregator
@merz1 thanks a lot.
a) now I put require_once($_SERVER[‘DOCUMENT_ROOT’].’/textpattern/lib/simplepie.inc’); it’s correct??
b) yes, I put ‘mediaplayer’ => ‘/js/mediaplayer.swf’
c) I put an opening bracket at the begining.
and then the output is like: http://www.cedre.cat/radio with a message:
Parse error: syntax error, unexpected $end in /home/cedrecat/public_html/textpattern/publish/taghandlers.php(3127) : eval()’d code on line 31
any idea??
Offline
#122 2010-10-13 13:30:24
Re: aks_rss : RSS parser and aggregator
c) Oh no. The last closing } bracket from the original code makes sense. It closes foreach($feed->get_items() as $item) {
. I just didn’t see it.
If you still get ‘path’ errors try:
a) Take the absolute path from TXP admin diagnosis. Should look like Textpattern-Path: /homepages/xx/yy/htdocs/stgi/textpattern
(my configuration) depending on your server configuration. Add /lib/simplepie.inc
.
b) See a)
Last edited by merz1 (2010-10-13 16:59:57)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#123 2010-10-13 14:24:04
- naoj77
- Member
- From: Barcelona, Catalunya
- Registered: 2007-01-19
- Posts: 15
Re: aks_rss : RSS parser and aggregator
thanks a lot @merz1,
I have the title and the description, look: http://www.cedre.cat/radio
but not mp3, that is inside tag <guid> is this normal??
thanks
Joan
Last edited by naoj77 (2010-10-13 14:24:59)
Offline
#124 2010-10-13 15:10:29
- naoj77
- Member
- From: Barcelona, Catalunya
- Registered: 2007-01-19
- Posts: 15
Re: aks_rss : RSS parser and aggregator
@merz1 solved!!!
this is the code:
the key is that tag <guid> can parse with get_id(), and now works fine!!!
thanks a lot.
<txp:php>
require_once('/home/cedrecat/public_html/textpattern/lib/simplepie.inc');
$feed = new SimplePie('http://www.radiosarria.cat/podcasts/40/podcast.xml', '/home/cedrecat/public_html/textpattern/tmp');
// Since we're initializing SimplePie at the top of the page, we can use this to set the headers.
// Otherwise, we'd use header(). http://php.net/header
$feed->handle_content_type();
// Loop through all of the items in the feed.
foreach($feed->get_items() as $item) {
// As long as the item has an enclosure (ONLY display items with enclosures)...
if ($enclosure = $item->get_enclosure()) {
// Display the title
echo '<h2>'.$item->get_title().'</h2>';
echo '<p>'.$item->get_description().'</p>';
echo '<p><txp:jnm_audio url="'.$item->get_id().'" /></p>';
}
}
</txp:php>
Offline
#125 2010-10-13 15:38:58
Re: aks_rss : RSS parser and aggregator
Congratulations. Esp. for finding the echo '<p><txp:jnm_audio url="'.$item->get_id().'" /></p>';
solution. I mentioned your solution in the txp:jnm_audio thread
but not mp3, that is inside tag <guid> is this normal??
I have no idea how multimedia feeds with embedded media links are (validly) constructed nowadays.
Important: But I do see that the MP3 URI is shown twice in the feed XML source:
This is the standard I know and SimplePie should show a simple flash media player:
<enclosure url="http://www.radiosarria.cat/sites/default/files/audio/programa_MAIG_2010.mp3" length="48052931" type="audio/mpeg" />
Edit: Doesn’t SimplePie show a simple player by itself? That’s what the SWF file is (deleted in latest version of your code) for.
Edit 2: What about echo $enclosure->embed();
? Check out simplepie_item/get_enclosure or plural simplepie_item/get_enclosures. The SimplePie API really became powerful over the years.
Using the ‘length’ and ‘type’ attributes are important informations for many players AFAIK!
And this is what you are using. (I think using the enclosure
tag is more correct as SimplePie also is checking if ($enclosure = $item->get_enclosure())
and not for guid
:)
<guid isPermaLink="false">http://www.radiosarria.cat/sites/default/files/audio/programa_MAIG_2010.mp3</guid>
[OT] PS: I miss Barcelona :)
Last edited by merz1 (2010-10-13 16:05:30)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#126 2010-10-13 16:10:01
- naoj77
- Member
- From: Barcelona, Catalunya
- Registered: 2007-01-19
- Posts: 15
Re: aks_rss : RSS parser and aggregator
ok,
but with get_link, inside of enclosure, don’t work, with embed work, but i don’t like this mediaplayer.
thanks a lot for your help @merz1
Offline
#127 2010-10-13 16:41:48
Re: aks_rss : RSS parser and aggregator
Well, .$item->get_link() fetches the <link>
for the whole single feed item parent (and not the enclosure child).
In your case it is only a funny (but helpful) coincidence that the RSS <guid> Element content is identical with the enclosure URI.
Are you sure that $enclosure->get_link(); does not work? Can you test:
echo '<p><txp:jnm_audio url="'.$enclosure->get_link().'" /></p>';
Last edited by merz1 (2010-10-13 17:41:52)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#128 2010-10-13 17:05:28
- naoj77
- Member
- From: Barcelona, Catalunya
- Registered: 2007-01-19
- Posts: 15
Re: aks_rss : RSS parser and aggregator
Yes, that work
thanks
Offline
#129 2010-10-13 17:12:00
Re: aks_rss : RSS parser and aggregator
@naoj77 Great. Now we have realized a nice & extendable SimplePie podcast aggregator for single enclosures. I like the result :)
@all Thanks for your patience with this off topic issue! I should have switched the issue to an extra thread much earlier. Lesson learned.
Jump back: For your convenience you may consider to directly beam to #113 to avoid the preceding off topic articles.
Last edited by merz1 (2010-10-13 17:39:31)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#130 2011-02-01 15:53:05
Re: aks_rss : RSS parser and aggregator
I’ve just updated a site from bit_rss to aks_rss.
- The page shows 20 feeds.
- Under bit_rss all 20 worked.
- Under aks_rss only 19 work.
- The feed that has quit working is from a blogspot blog
- all other blogspot blogs are working
- The feed is validates
- I can subscribe to the feed with other rss readers
- The message shown by aks_rss is “0No feed items.” (different from the advertised “No feed items could be found.”)
- I don’t believe it is the tags, etc.
- The only change I made was replacing “bit” with “aks” using find and replace in my text editor
- I’ve pasted the feed url into code I know is working with other urls and it doesn’t work there either.
Thoughts and suggestions?
Thanks
Mike
Offline
#131 2011-07-06 18:42:52
Re: aks_rss : RSS parser and aggregator
Hello Markus. I’m using one of your simple scripts to view this rss feed: http://vahomeschoolers.org/blog/feed/, but it does not view. However, when I use alternative rss feeds they show. Maybe you could enlighten me to my obvious error?
Here’s the code I’m using: <txp:aks_rss limit=“8” form=“feed_listing” feed=“http://vahomeschoolers.org/blog/feed/” />
Best,
Richard
Living the Location-Independent Life: www.NuNomad.com
Offline
#132 2011-07-06 22:45:36
Re: aks_rss : RSS parser and aggregator
Richard, don’t get me wrong but I have no idea which ‘simple script’ you might talk about. I have no scripts and should you talk about the previous off-topic SimplePie media player thread … this should not continue here :)
OK, you are using the aks_rss plug-in.
What does it show?
The SimplePie demo for your feed looks pretty good.
Last edited by merz1 (2011-07-06 22:47:31)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline