EllisLab text mark
Advanced Search
2 of 8
2
   
ANO XML Parser
Posted: 04 January 2009 03:13 AM   [ Ignore ]   [ # 19 ]   [ Rating: 0 ]
Joined: 2002-07-24
9 posts

Redacted for my own stupidity!

 
Posted: 13 January 2009 09:12 PM   [ Ignore ]   [ # 20 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
arnoldc - 25 December 2008 03:01 AM

Hi Bob,

Yes, this module is very basic and doesn’t implement some of the EE tags that you would usually see in first-party modules.  Conditional case is not implemented.

Hi Bob,

I have just updated the parser to v1.1 with three new changes:

- added limit tag
- added duplicated element name support
- added conditional variable

Sample template codes to your xml feed:

{exp:ano_xml_parser:fetch
source
='http://ws.audioscrobbler.com/2.0/user/Taggetig/topartists.xml'
refresh='0' parent_tag='topartists' child_tag='artist' limit="10"}
Name
{artist_name}Ranking{artist_rank}<br>
URL:: <a href='{artist_url}'>{artist_url}</a><br/>
{if artist_image} image size={artist_image_size}: <img src='{artist_image}'/><br/>{/if}
{if artist_image_2}  image size
={artist_image_size_2}:{artist_image_2}<br/>{/if}
{if artist_image_3} image_size
={artist_image_size_3}:{artist_image_3}<br/>{/if}
<hr>
{/exp:ano_xml_parser:fetch} 

Please download v1.1 in the Wiki area.

 
Posted: 15 January 2009 12:41 PM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Joined: 2006-01-20
166 posts

arnold, thanks so much, it does everything I wanted it to do now. much appreciated smile

 Signature 

buro taggetig: freelance web design from Belgium.  |  Follow me on Twitter

 
Posted: 15 January 2009 03:13 PM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
bobh - 15 January 2009 05:41 PM

arnold, thanks so much, it does everything I wanted it to do now. much appreciated smile

Great! I have just moved to the version to the Wiki area.

 
Posted: 23 January 2009 06:52 PM   [ Ignore ]   [ # 23 ]   [ Rating: 0 ]
Joined: 2008-08-04
16 posts

Thanks for the reply at Solspace Arnold. Before I get it installed, is this XML too deeply nested to use the module, or do you think it would work?

http://api.oodle.com/api/v2/listings?key=TEST&region=chicago&category=vehicle/car

 
Posted: 23 January 2009 10:17 PM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
swillia1 - 23 January 2009 11:52 PM

Thanks for the reply at Solspace Arnold. Before I get it installed, is this XML too deeply nested to use the module, or do you think it would work?

http://api.oodle.com/api/v2/listings?key=TEST&region=chicago&category=vehicle/car

Just tested it and seem to work fine with the link.

Sample Code

{exp:ano_xml_parser:fetch
source
='http://api.oodle.com/api/v2/listings?key=TEST&region=chicago&category=vehicle/car'
refresh='0' parent_tag='listings' child_tag='element' limit="10"}
ID
:{element_id}<br>
body:{element_body}<br>
location name{element_location_name}<br>
image element 1 source:{element_images_element_src}<br/>
image element 2 source:{element_images_element_src_2}<br/>
price:{element_attributes_price}<br/>
<
hr>
{/exp:ano_xml_parser:fetch} 
 
Posted: 29 January 2009 12:05 PM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Joined: 2008-08-04
16 posts

I uploaded the module, but get the following error when I click on the modules tab:

Unable to load the following language file:

lang.ano_xml_parser_1_1.php

The language file that was with the ZIP was lang.ano_xml_parser.php, so is this an error with the naming of the language file or in the code of the module?

Sorry for the questions but still a bit of an EE newb.

 
Posted: 29 January 2009 12:17 PM   [ Ignore ]   [ # 26 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts

You need to put the language file in the right directory, ie /system/languages/english.

 
Posted: 29 January 2009 01:52 PM   [ Ignore ]   [ # 27 ]   [ Rating: 0 ]
Joined: 2008-08-04
16 posts

Finally solved it:

Ingmar Greil - 29 January 2009 05:17 PM

You need to put the language file in the right directory, ie /system/languages/english.

Moved the language file, but still getting the same error:

Unable to load the following language file:

/lang.ano_xml_parser_1_1.php

************

The ZIP file had the ‘_1_1’ appended on the end for the version info, but that needed to be removed to have the file names process correctly. Just a heads up for anyone else that is installing this module. Now to see if we can get it to work…

 
Posted: 29 January 2009 04:41 PM   [ Ignore ]   [ # 28 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts

Sorry for missing the obvious.  i have repacked the files so it makes more logical sense for installation and the link has been updated in the Wiki area.  Nothing has changed so you don’t need to re-download it.

 
Posted: 08 February 2009 03:06 AM   [ Ignore ]   [ # 29 ]   [ Rating: 0 ]
Joined: 2008-11-22
6 posts

I discovered your module and it’s JUST what I need. I have one problem, and I’m not sure if this is something I’m overlooking or if it’s something the module doesn’t support.

Here’s an example of the xml data I’m trying to parse:

<item>
    <
Description>COSBY SHOWSEASON 4THE Video</Description>
    <
Title>COSBY SHOWSEASON 4THE</Title>
    <
Rating>Not Rated</Rating>
    <
Genre>Comedy</Genre>
</
item

I’m trying to filter out anything that’s NOT rated PG or G. I tried this conditional:

{if item_Rating == "PG"}{item_Title}{/if} 

That type of conditional doesn’t seem to work. Is it possible to do more with this module than just check for the existence of an element?

Thanks for the help and the great module!

 
Posted: 09 February 2009 03:04 PM   [ Ignore ]   [ # 30 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
david.brunelle - 08 February 2009 08:06 AM

I’m trying to filter out anything that’s NOT rated PG or G. I tried this conditional:

{if item_Rating == "PG"}{item_Title}{/if} 

That type of conditional doesn’t seem to work. Is it possible to do more with this module than just check for the existence of an element?

Thanks for the help and the great module!

Yes, it only supports one conditional right now.  I’ll try to add a few more useful conditionals in next version. Stay tune.

 
Posted: 09 February 2009 06:45 PM   [ Ignore ]   [ # 31 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts

Okay, I just added standard EE operators on conditional variables. Actually it is pretty straight forward as EE built-in functions take care of everything.

As usual, version 1.2 can be downloaded in the Wiki area.

Example code:

{exp:ano_xml_parser:fetch source='http://www.w3schools.com/xml/simple.xml' refresh="0" parent_tag="breakfast_menu" child_tag="food"}
Food Name
{food_name} with only {food_calories} calories<br>
Price{food_price}<br>
Description{food_description}<br>
{if food_name=="Belgian Waffles" OR food_calories<700}
I LOVE TO EAT {food_name} 
OR ANY FOOD WITH LESS THAN 700 calories.<br/>
{/if}
{if food_dummy}
THIS LINE SHOULD NEVER BE SHOWN SINCE VARIABLE DOESN
'T EXIST!<br/>
{/if}
<hr>
{/exp:ano_xml_parser:fetch} 
 
Posted: 09 February 2009 11:03 PM   [ Ignore ]   [ # 32 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-22
22 posts

If we executed the xml parser twice in the same page, it only showed the rss data from the first one.
So, the second one was totally gone and it became just a duplicated copy of the first one.
Is that a bug or Did I make any mistake?

<h2>Technology</h2>
{exp:ano_xml_parser:fetch source='http://www.playpark.net/playpark/feed20/technology' refresh='0' parent_tag='channel' child_tag='item' limit='5'}
<a href='{item_link}' target='_blank'>{item_title}</a> <br />
<
small>Posted on {item_pubdate}</small>
<
hr>
{/exp:ano_xml_parser:fetch}

<h2>Lifestyle</h2>
{exp:ano_xml_parser:fetch source='http://www.playpark.net/playpark/feed20/lifestyle' refresh='0' parent_tag='channel' child_tag='item' limit='5'}
<a href='{item_link}' target='_blank'>{item_title}</a> <br />
<
small>Posted on {item_pubdate}</small>
<
hr>
{/exp:ano_xml_parser:fetch} 
 
Posted: 10 February 2009 04:45 PM   [ Ignore ]   [ # 33 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
StudioAMK - 10 February 2009 04:03 AM

If we executed the xml parser twice in the same page, it only showed the rss data from the first one.
So, the second one was totally gone and it became just a duplicated copy of the first one.
Is that a bug or Did I make any mistake?

Yes, it is a bug and it is now fixed.  You can try the latest version 1.2.1 in the wiki area.  Thanks for reporting.

 
2 of 8
2