Textpattern Forum

You are not logged in. Register | Login | Help

#171 2012-06-26 20:11:26

uli
Moderator
From: Cologne/Köln
Registered: 2006-08-15
Posts: 3,086

Re: smd_xml : extract data from XML feeds

The comma behind LastMod=NOW()?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#172 2012-06-26 20:14:11

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: smd_xml : extract data from XML feeds

uli wrote:

The comma behind LastMod=NOW()?

no that did not fix it, neither did LastMod='NOW()',

also i’m running this test site on xampp, not sure if it would affect anything.

{Edited to add @‘s: Textile swallowed parentheses otherwise. – Uli}

Last edited by uli (2012-06-26 20:34:25)

Offline

#173 2012-06-26 20:45:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_xml : extract data from XML feeds

mrtunes

It works for me with the latest beta (though I’m running a development copy of smd_query too, that shouldn’t affect it).

Can you output stuff from your feed to the screen inside the smd_xml container ok?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#174 2012-06-26 20:59:55

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: smd_xml : extract data from XML feeds

Bloke wrote:


It works for me with the latest beta (though I’m running a development copy of smd_query too, that shouldn’t affect it).
Can you output stuff from your feed to the screen inside the smd_xml container ok?

yes it’s outputting without the query section. so i’m going to now assume it’s something to do with running a local server. the problem is i dont want to test on a live one, and then spit articles into the rss feed.

Last edited by mrtunes (2012-06-26 21:00:15)

Offline

#175 2012-06-26 21:09:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_xml : extract data from XML feeds

mrtunes wrote:

yes it’s outputting without the query section. so i’m going to now assume it’s something to do with running a local server.

Or maybe it’s a problem with smd_query. Wanna try my version?

Last edited by Bloke (2012-06-26 21:09:59)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#176 2012-06-27 19:54:19

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: smd_xml : extract data from XML feeds

Bloke wrote:

Or maybe it’s a problem with smd_query. Wanna try my version?

Ok. where do i grab it?

also did you see my other question about mixing multiple feeds?

Offline

#177 2012-09-19 17:37:32

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 685
Website

Re: smd_xml : extract data from XML feeds

Hi Stef, I’m trying to parse a youtube feed. The link field appears many times, but I would like to use only the first occurrence. Is it possible? The concat parameter let me use the last, and that’s not useful for me. A related question: the link fields appear with different attributes. Is it possible to target only the fields that has some attribute and not the others? E.g.

<entry>
<id>http://gdata.youtube.com/feeds/api/videos/XXXXX</id>
...
<link rel="alternate" type="text/html" href="https://www.youtube.com/watch?v=XXXXX&amp;feature=youtube_gdata"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/videos/XXXXX/responses"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/videos/XXXXX/related"/>
<link rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html" href="https://m.youtube.com/details?v=XXXXX"/>
<link rel="self" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/users/p40it/uploads/XXXXX"/>
</entry>

I’d like to use the href content of the first link. There is a way I could try to use type or rel=“alternate” to target it?

Offline

#178 2012-09-19 19:49:25

etc
Plugin Author
Registered: 2010-11-11
Posts: 1,232
Website

Re: smd_xml : extract data from XML feeds

Stef, may I..?


etc_[ query | search | pagination | date | tree | url ]

Offline

#179 2012-09-19 20:00:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_xml : extract data from XML feeds

etc wrote:

Stef, may I..?

Be my guest. This plugin has rotted to the point I was considering overhauling it, then yours came along so I didn’t need to bother!

Although istr the latest smd_xml beta will do what Zanza wants, I’d have to refresh my memory on what options to use to do it, and it may well involve smd_if. Yours will be faster, I’m sure.

Last edited by Bloke (2012-09-19 20:00:56)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#180 2012-09-19 20:22:02

etc
Plugin Author
Registered: 2010-11-11
Posts: 1,232
Website

Re: smd_xml : extract data from XML feeds

Thanks for the welcome, sir!

Bloke wrote:

Yours will be faster, I’m sure.

Not at all, the network connection to youtube will take 99.99% of time with both anyway. I simply think xpath is a right thing to use here. Importing the first link’s href takes no more than

<txp:etc_query url="...youtube..." markup="xml" query="string(//entry/link[1]/@href)" />

provided there is only one entry in the feed.


etc_[ query | search | pagination | date | tree | url ]

Offline

Board footer

Powered by FluxBB