Parse part of phpBB Atom feed to PHP page as average



I hope to god I'm asking in the correct place...


I run a phpBB forum which uses atom feeds. I have one feed inparticular (For examples sake: http://ift.tt/13pHiHW) that I want to work with. Through phpBB's BBcodes I can add an element? if that's the correct term, to a particular part of the feed so it looks/parses like:



<price>PRICE_HERE</price>


The PRICE_HERE is what a user would add in a topic/post, which of course then shows in the feed as an actual number.


What I would like to do is: Have a simple/bare bones php page (For examples sake: mypage.php) which will pull all those prices from the feed and display/output an average. So if there are only two prices in the feed at:


1 - £0


2 - £10


Then of course the page would display:



5.



Or ideally at least a little extra HTML like:



The average asking price is: £5



I have searched long and hard, and tried cobbling together various bits of code but I'm not at all experienced with this kind of thing.


For some insight, the idea is that the feed is from a forum section where cars are sold, and I'd like to be able to display the average selling price. I may (If I can gain some help/samples) need to complicate further due to currency too, but I'll leave that for now.


I hope you find my post of interest enough to be able to help me, I have torn half my hair out in trying to learn (With little time) but failing miserably.


Thanks, Neil.


No comments:

Post a Comment