]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/InstapaperImport.php
Merge remote-tracking branch 'origin/master' into 2.4
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / InstapaperImport.php
index df1d66665ca7f8dd3344874062e82b2d534b9fc4..f7bee9ef01dc13625d94f024f760efa103be32cd 100644 (file)
@@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport
         }
 
         $entries = [];
-        $handle = fopen($this->filepath, 'rb');
+        $handle = fopen($this->filepath, 'r');
         while (false !== ($data = fgetcsv($handle, 10240))) {
             if ('URL' === $data[0]) {
                 continue;
@@ -79,7 +79,6 @@ class InstapaperImport extends AbstractImport
             $entries[] = [
                 'url' => $data[0],
                 'title' => $data[1],
-                'status' => $data[3],
                 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3],
                 'is_starred' => 'Starred' === $data[3],
                 'html' => false,
@@ -94,6 +93,10 @@ class InstapaperImport extends AbstractImport
             return false;
         }
 
+        // most recent articles are first, which means we should create them at the end so they will show up first
+        // as Instapaper doesn't export the creation date of the article
+        $entries = array_reverse($entries);
+
         if ($this->producer) {
             $this->parseEntriesForProducer($entries);