Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_xml : extract data from XML feeds
if you are open for javascript, then jquery could do it..
post your exact code (like surounding divs and stuff, so that it would be easier to select a certain item..) and maybe we are able to help..
Offline
Re: smd_xml : extract data from XML feeds
This is the sort of Tweets they send:
Parks Brigade are planning to undertake a hazard reduction burn on Sunday, weather permitting on Quartz Ridge near... http://fb.me/Y6Q0OYA8
In other words, they are posting full updates to the Facebook page and tweeting about the update. Sometimes, the tweet is just a URL to their photo gallery site.
As I say, I know that this is not an issue with the plugin, but I know from personal experience that the more we push Bloke’s plugins the more we find crazy things we want to do, and then he comes up with an even better plugin!
Offline
Re: smd_xml : extract data from XML feeds
well, dunno. i would do it via jquery, but maybe you are right, and bloke could provide some new build-in feature..
bloke?
Offline
#100 2011-03-31 12:19:30
Re: smd_xml : extract data from XML feeds
blokes plugins great great – but there area others which target twitter directly – I have used kml_twitter on an old site 4.08 – so not sure if it still works… but I had it working in 5 mins, links and all :)
Last edited by tye (2011-03-31 12:20:04)
Offline
#101 2011-04-13 13:12:40
Re: smd_xml : extract data from XML feeds
You were right – kml_twitter
did the job very neatly for me.
But still waiting for the version that allows attributes on fields!
Offline
#102 2011-09-29 08:44:12
Re: smd_xml : extract data from XML feeds
Stef – going back to this feed
http://gdata.youtube.com/feeds/api/users/roundmountaingirls/uploads?v=2
I am trying to get a field called <media:description> which is enclosed within a <media:group> (along with other things)
<media:group><media:description type='plain'>Cabarita Sports Club had their biggest night ever, says club management, when the Round Mountain Girls did their home town show last Saturday night. This clip is a short shot of the audience and RMG with Banjovi introducing the band... 4 June 2011</media:description></media:group>
How do I do that?
I’ve tried {media:group}, {media:description}, {description}, {group}, {media|description} (as you can tell I have no idea)
Is there a way?
Offline
#103 2011-10-05 05:30:26
Re: smd_xml : extract data from XML feeds
Hey Stef – I was making that hard – media:description worked :)
In the same feed though under nested in <media:group> </media:group>
I am trying to get media:content & media:thumbnail
– If I include fields="media:category"
then I have the placement tags {media:category}, {media:category|label}, {media:category|scheme}
, but if I include fields="media:thumbnail, media:content"
– I get nothing :(
When using debug=“3” – are the fields listed under “++ PAGING INFO ++” the ones you can extract and are these the replacement tags to use – or does this depend on what values you have used in the tag?
Would it be possible to include a return all fields (without specifying) – so you know which replacement tags to use?
Just trying to understand how smd_xml working :)
Also – I’m using v.30 – is there a dev version I have heard mentioned :) Care to share?
Cheers
Offline
#104 2011-10-06 01:33:26
Re: smd_xml : extract data from XML feeds
Pssssst, Tye or anyone else who wants to try the next beta
Loads of goodies packed into this release that should solve all the issues people have raised over the last few months. For example, you can now specify field hierarchies, which is damn handy if the XML feed reuses the same node name in many places: you can just target the specific->node->tree->name
you want (if you need just the root one, prefix it with the record name).
If that’s not enough granularity you can also match nodes based on their content (using a regex). And if you want to get really funky you can ‘watch’ for tags in real time and trigger a Txp form whenever that tag starts or ends (see ontagstart / ontagend). One thing I wanted to add but haven’t yet managed (because of the ugly code requirements) is the ability to specify wildcards for extracting tags. That’d be frickin’ cool, but remains a pipe dream at the moment and I’ve wasted enough time trying to get it to work already.
What else is in this version. Erm, tentative support for XSLT to be applied to your XML document (willing testers required: I know jack-all about XSL) or you can apply custom regex replacements to clean up the feed or trim it to your liking. Plus a slew of bug fixes, FTP and SOAP support, datawrap
for awkward / malformed feeds, var_prefix
so you can embed smd_xml tags inside smd_xml tags(!) yahde yahde…
Please let me know how you get on with this beta and if there’s anything squiffy about it I’ll fix it before it’s final. All things being well I can release it like this, but it could do with some more examples in the help so if anyone comes across some really cool uses of the new attributes, please let me know and I’ll put them in.
Share and Enjoy™
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#105 2011-10-06 03:01:35
Re: smd_xml : extract data from XML feeds
way cool – thanks stef :)
initial testing looks great – I’ll be working on this full time tomorrow
Thanks mate :)
Offline
#106 2011-10-07 03:52:23
Re: smd_xml : extract data from XML feeds
OK – stef I’ve been testing extracting hierarchical nodes
I’ve thrown all kinds of feeds at this Facebook, Youtube, Vimeo, xml formatted files, rss blog feeds – and it worked perfectly with all of them – except one (from txp’s arch enemy)
http://en.blog.wordpress.com/feed/
This one has an enclosed media:content field – I can get the media:title fine… but I can’t get the url from the media:content
I was using
{media:content|url}
& {media:content}
<media:content url="http://1.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=96&d=retro" medium="image">
<media:title type="html">Matt Mullenweg</media:title>
</media:content>
Offline
#107 2011-10-07 10:37:31
Re: smd_xml : extract data from XML feeds
tye wrote:
it worked perfectly with all of them – except one
Woah! Thanks for the report. Just fixed a howler of a bug that was in the plugin since, like, forever.
New beta uploaded to the same place so please re-download it and let me know how it performs on this feed, and please verify it’s not broken anything with the other ones you’ve tested.
Sorry about that. hangs head in shame
Last edited by Bloke (2011-10-07 10:37:51)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#108 2011-10-08 00:54:02
Re: smd_xml : extract data from XML feeds
Bloke wrote:
Sorry about that. hangs head in shame
What for? You are a txp legend :)
Quick weekend test confirms that now works perfectly – thanks
I’ll give it proper test again next week, have a great weekend :)
Offline