Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2008-03-10 09:20:20
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] jk_parse_xml: get data from XML feeds
Hi Jeff,
I’ve had a good experiment with various things and have had some success and some weird results.
re: the size of the XML file – yes – its a worry – but ATM thats all that is on offer. That’s why I’d be dead keen to get a cached version happening. I may have to resort to a cron job to update a local file every now and again.
Here are the results of my testing:
Current plugin- The plugin is working with a local file (obviously with local_file = 1)
- Yes – you were right – I changed “events” to “event” and that worked
- The plugin works with a remote file BUT only when I have the variable local_file still set to 1 ??? I have double and triple checked this.
- I can tell its loading the remote file due to the delay and the fact that I deleted any copy of the local file during testing
- I still need to fake a user agent code – so I presume it is using cURL
- I tried the cached plugin (0.3a) and get a ton of errors complaining of a missing file.
- I tried inserting the fake user agent – still no luck…
I’m really interested to see if you can make sense of all of that :)
SH
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
I can’t get it to replicate the your problem with the local_file variable.. Can you try version .31 and let me know if that still causes problems.
I am just sorting through the caching now…
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
Scratch that. I released version .4 which included file caching. Many thanks to everyone here for input and code!
Vitruvius, can you give it a shot and see if it works for you? Seems pretty speedy for me even with the 156k file.
Offline
#28 2008-03-10 21:58:49
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] jk_parse_xml: get data from XML feeds
Hi Jeff,
Thank you very much for your work on this!
I tried version 0.4 and get the following error when trying to load an external file:
tag_error <txp:jk_parse_xml xml="http://www.eventbrite.com/rest/organizer_list_events/15857229" form="xml-test" local_file="0" parents="event" elements="title,start_date,end_date,city,link" limit="100" wraptag="div" break="p" /> -> Warning: fopen() expects at least 2 parameters, 1 given on line 44
tag_error <txp:jk_parse_xml xml="http://www.eventbrite.com/rest/organizer_list_events/15857229" form="xml-test" local_file="0" parents="event" elements="title,start_date,end_date,city,link" limit="100" wraptag="div" break="p" /> -> Warning: implode() [function.implode]: Bad arguments. on line 4
Tested a local file and had no problems.
Any ideas?
SH
Last edited by Vitruvius (2008-03-10 21:59:04)
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
Try .41. Looks like you have allow_url_fopen turned on, which means it shouldn’t need to use curl..
Offline
#30 2008-03-11 00:35:15
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] jk_parse_xml: get data from XML feeds
Hi Jeff,
I hope you can’t tell that I really don’t know too much about server stuff! fopen, cURL it all sounds good to me :)
Tried 0.41, got only one error (and no output)
tag_error <txp:jk_parse_xml xml="http://www.eventbrite.com/rest/organizer_list_events/15857229" form="xml-test" local_file="0" parents="event" elements="title,start_date,end_date,city,link" limit="100" wraptag="div" break="p" /> -> Warning: implode() [function.implode]: Bad arguments. on line 45
Thanks!
SH
Offline
Offline
#32 2008-03-11 21:47:30
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] jk_parse_xml: get data from XML feeds
Hi Gocom – I’m using PHP v5.2.4, mySQL v4.1.22-standard
I have got the jk_parse_xml plugin working but only using a local file (so I update this using a cron job). The plugin displays the ‘tour’ events on architecture.org.au
Jeff – I had a look to make a donation to your project – but the donation form is showing a 404…
SH
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
Vitruvius, can you try v0.42: http://jeffkhonsary.com/plugindev/jk_parse_xml.php and see if that works?
Jeff
Offline
#34 2008-03-13 22:03:18
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] jk_parse_xml: get data from XML feeds
Jeff – well done – that worked a treat.
Threw an initial permission denied error. I CHMODed the /textpattern/cache/ directory from its 755 to 777 and the plugin works a treat.
Perfect!
S
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
Just found this as I was looking at xml today – but I have a few questions.
1 – Some of the remote feeds I was looking at were gzip’d… these didn’t work, so I am presuming that I would need to unzip these before using them.
2 – Say if I’m using a merchants product feed – would there be a way of splitting the feed into the feed categories and display them in txp categories? I’m looking at txp:variable at the mo… just wondering if it is possible with the plugin.
nm… just thinking out loud now… so I’ll leave it there for the moment
Offline
Re: [plugin] jk_parse_xml: get data from XML feeds
It looks as if this plugin has been abandoned, but it looks great for what I need… If I could get it working. Does anyone have any examples of the contents inside the form that it references?
In my page I have
<txp:jk_parse_xml xml=“http://calendar.peopleschurch.org/category/high-school/feed” local_file=“0” form=“event_display” parents=“channel” elements=“title” />
and in “event_display” I have
<txp:jk_xml_element name=‘title’>
The plugin returns a ordered list with a single item, but no title… What am I doing wrong?
Offline