summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-25 12:02:30 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-25 12:03:21 +0200
commit4ca4b190c831163572491e1afbc42f2799652d76 (patch)
treec8083f8b6751f5cf110e75f0ab573678af1216dd /utility
parent01923197d675380404ef9fe0ff3aef743afc65ad (diff)
import in reversed order because first item is the newest one, #80
Diffstat (limited to 'utility')
-rw-r--r--utility/importparser.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/utility/importparser.php b/utility/importparser.php
index 4babefda5..38dec4b44 100644
--- a/utility/importparser.php
+++ b/utility/importparser.php
@@ -42,7 +42,13 @@ class ImportParser {
$items = array();
if(array_key_exists('items', $json)) {
- foreach($json['items'] as $entry) {
+ $jsonItems = $json['items'];
+
+ // reverse because highest entry is the newest one and we cant rely
+ // on a set pubdate
+ for($i=count($jsonItems)-1; $i>=0; $i--) {
+ $entry = $jsonItems[$i];
+
// we require title, guid and url
if(!array_key_exists('title', $entry)
|| !array_key_exists('id', $entry)