ordonează-fluxurile-după-dată.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * File name: ordonează-fluxul-după-dată.php
  4. * Sort an RSS feed by pubDate
  5. *
  6. * (C) Copyright 2013 Friedrich-Ebert-Stiftung (http://fes.ro)
  7. * Author: Tiberiu C. Turbureanu (tct@ceata.org)
  8. *
  9. * This file is part of the project funded by FES
  10. *
  11. * This is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. */
  25. require_once 'utile.php';
  26. // Load the list of persons
  27. $persons = array();
  28. $xmla = new DOMDocument();
  29. $xmla->load('../20131013-consilieri.xml');
  30. $xpatha = new DOMXpath($xmla);
  31. $persons = $xpatha->query("/xml/person");
  32. foreach($persons as $person)
  33. {
  34. $comname = $xpatha->query("comname", $person)->item(0)->nodeValue;
  35. $surname = $xpatha->query("surname", $person)->item(0)->nodeValue;
  36. $res_file = $rss_file = '../fluxuri/02-teste/'.$comname.'-'.$surname.'.xml';
  37. $xsl_file = '../stiluri/flux-ordonat-după-dată.xsl';
  38. transformă($rss_file, $xsl_file);
  39. }
  40. ?>