Ah, it’s a bug.
It is now fixed in version 1.2.4 in which you can download in the Wiki area.
Thanks for reporting.
When taking date information from a feed, is there a way of limiting it, or formatting it in a different way? At the moment, I have Sat, 23 May 2009 20:00:00 -0700, when really all I’d like is the date, without the time.
Additionally, there’s & in the title tag in the RSS source code, which is ignored entirely when parsed.
When taking date information from a feed, is there a way of limiting it, or formatting it in a different way? At the moment, I have Sat, 23 May 2009 20:00:00 -0700, when really all I’d like is the date, without the time. Additionally, there’s & in the title tag in the RSS source code, which is ignored entirely when parsed.
Sorry, the parser just takes the raw data, you may need to resort to Javascript for this purpose.
If you are doing standard RSS feed, perhap Magpie is a better choice. This parser will parse child elements in RSS only.
I’m trying to use this to parse Jrank search resuts instead of EE’s own search
Here’s the form:
<form action="{path=search/jrank}" method="get">
<input id="q" name="q" style="display: inline; vertical-align: middle;" type="text" value="" />
<input name="commit" style="display: inline; vertical-align: middle;" type="submit" value="Search" />
</form>
here’s the results page:
<?php
global $IN, $REGX;
$query = $IN->GBL('q', 'GET');
$query= $REGX->xss_clean($query);
?>
<h1>Search Results for "<?php if ($query !== FALSE) {echo $query;} ?>"</h1>
{exp:ano_xml_parser:fetch
source='http://www.jrank.org/api/search/v2.xml?key=c899f339833cd7f594b2eaa5915e903bbae8a0e6&q=<?php echo $query; ?>'
refresh='0' parent_tag='entries' child_tag='entry'}
{entry_title}<br>
<!--{entry_content}
-->
<a href="http://{entry_url}">{entry_url}</a>
{/exp:ano_xml_parser:fetch}
It doesn’t look like I can include PHP within the opening tag in order to pass my search term to Jrank
Any ideas?
I just tried the following codes and it works. The key thing is that you have to setup the parsing stage of the template file to be “Input”, not “Output” in the Preferences section.
<?php
echo "<h1>W3C Sample XML Test</h1>";
$url = "http://www.w3schools.com/xml/simple.xml";
echo "URL = ".$url."";
?>
{exp:ano_xml_parser:fetch source='<?php print $url; ?>' refresh="0" parent_tag="breakfast_menu" child_tag="food"}
{if food_name=="apple"}
i love apple very much
{/if}
Food Name; {food_name} with only {food_calories} calories
Price: {food_price}
Description: {food_description}
<hr>
{/exp:ano_xml_parser:fetch}
Sorry if this is a simple question but how would i display this url…
http://kadampa.smugmug.com/photos/601411301_XYYaj-Ti.jpg[code]
From inside...
[code]<link rel="icon" type="image/jpeg" href="http://kadampa.smugmug.com/photos/601411301_XYYaj-Ti.jpg"/>
Within this feed?
Thanks for this truly awesome plugin!
I see you want to parse an Atom feed and you want to parse the link tags. The parser can only parse one one type of child at a time, so perhap you can setup another feed to parse the link elements and to extract the icon image.
See codes:
<h1>ATOM Link Test</h1>
{exp:ano_xml_parser:fetch source='http://kadampa.smugmug.com/hack/feed.mg?Type=gallery&Data=9034508_kbZUi&format=atom03&Size=Small&ImageCount=100' refresh="0" parent_tag="feed" child_tag="link" limit="5"}
LINK TYPE={link_type}<br>
LINK REF={link_href}<br>
{if link_type=="image/jpeg"}
<img ><br>
{/if}
<hr>
{/exp:ano_xml_parser:fetch}
*** apparently the forum filters out the image tag so it appears as empty in the code section but you should simply fill it in by setting the src to {link_href}.
Sure. See the following example code.
<h1>RSS Image Links Test</h1>
{exp:ano_xml_parser:fetch source='http://api.smugmug.com/hack/feed.mg?Type=gallery&Data=9034508_kbZUi&format=osrss&ImageCount=100&Sandboxed=1' refresh="0" parent_tag="channel" child_tag="item" limit="2"}
Item Title={item_title}<br>
Media URL 1={item_media:group_media:content_url}<br>
Media URL 2={item_media:group_media:content_url_2}<br>
Media URL 3={item_media:group_media:content_url_3}<br>
<!-- illustrate use of condition to detect existence of variable -->
{if item_media:group_media:content_url_4}
Media URL 4={item_media:group_media:content_url_4}<br>
{/if}
{if item_media:group_media:content_url_99}
Media URL 99=THIS LINE SHOULD NOT APPEAR
{/if}
<hr>
{/exp:ano_xml_parser:fetch}
I’m trying to use this module to show only xml entries that have an attribute set to “Yes” with all other details is this possible? The code I am using is below…
{if news_live=='Yes'}
Title = {news_title} br >
Link = {news_link}
<hr>
{/if}
If not can anyone suggest another extension/module that could do this?
kreate, is the code not working for you? It should work.
Anyway, here’s an example that illustrates the use of conditional and it works:
<h1>W3C XML Conditonal Test</h1>
{exp:ano_xml_parser:fetch source='http://www.w3schools.com/xml/simple.xml' refresh="0" parent_tag="breakfast_menu" child_tag="food"}
{if food_name=="Belgian Waffles"}
I LOVE TO EAT {food_name}. The price is: {food_price}<br>
<hr>
{/if}
{/exp:ano_xml_parser:fetch}
Thanks, for some reason it has now started working so not sure what the problem was. I am having another issue now though which I do not know the answer to. I want to limit the number of results to 5 results that are set to live. If only 2 out of the first 5 have this setting then it will only display the 2 results and not the first 5 that are set to be live. Is there a way i can achieve this?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.