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
#133 2011-07-06 23:54:48
Re: aks_rss : RSS parser and aggregator
Markus,
I should have said simple “tag,” which is this: <txp:aks_rss limit=“8” form=“feed_listing” feed=“http://vahomeschoolers.org/blog/feed/” />
The content from that website is simply not viewing on my page.
Living the Location-Independent Life: www.NuNomad.com
Offline
#134 2011-07-11 16:50:17
Re: aks_rss : RSS parser and aggregator
I’m frustrated. I’m using the aks_rss tag as indicated above and it will not show anything (I get this error message on the top of my page: “A feed could not be found at http://vahomeschoolers.org/blog/feed/”). But when I swap the feed link to another (http://feeds.bbci.co.uk/news/rss.xml) it views. And, as Markus pointed out in his Simple Pie demo, it shows there.
Could the problem be that I’m required to use Simple Pie with the aks_rss plug-in for this feed location?
Perhaps someone has an alternative tag example I could try?
Thanks for your patience with me.
Living the Location-Independent Life: www.NuNomad.com
Offline
#135 2011-07-11 21:18:29
Re: aks_rss : RSS parser and aggregator
And, as Markus pointed out in his Simple Pie demo, it shows there.
It is not my SP demo. It’s their standard demo page.
Nevertheless this demo page is my fast standard check for feeds.
Oh, 1st I open the feed URL in Firefox (and check it) and from there I have a ‘subscribe with SimplePie’ which is explained somewhere on the SP site how to do it and which is the convenient way to hand over the feed to the demo page.
Could the problem be that I’m required to use Simple Pie with the aks_rss plug-in for this feed location?
AFAIK (pretty sure) aks_rss uses the SimplePie library
Perhaps someone has an alternative tag example I could try?
I am still using the original SimplePie Textpattern plug-in v.1.2.2. AFAIK with the latest SimplePie library file.
Richard a fast check if the feed is not in the page. Just to make sure that the output is not hidden for what ever obscure reason:
- wrap aks_rss tag in HTML comments
- Do a forced reload in your browser for that page/article
- Check for the comments and what is between them in the HTML source code
Richard, a fast check if the feed is fetched by the plug-in and make sure you have a fresh feed file:
- Empty the SimplePie cache directory on the server
- Do a forced reload in your browser for that page/article (and check page/HTML :)
- Check the SimplePie cache directory on the server for the cached feed file
- If file is there open it with text editor and check if the XML contains the correct content
Let us know.
Last edited by merz1 (2011-07-11 21:20:02)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline