diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/InstapaperImport.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 5a18c7c0..f7bee9ef 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php | |||
@@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport | |||
62 | } | 62 | } |
63 | 63 | ||
64 | $entries = []; | 64 | $entries = []; |
65 | $handle = fopen($this->filepath, 'rb'); | 65 | $handle = fopen($this->filepath, 'r'); |
66 | while (false !== ($data = fgetcsv($handle, 10240))) { | 66 | while (false !== ($data = fgetcsv($handle, 10240))) { |
67 | if ('URL' === $data[0]) { | 67 | if ('URL' === $data[0]) { |
68 | continue; | 68 | continue; |
@@ -79,7 +79,6 @@ class InstapaperImport extends AbstractImport | |||
79 | $entries[] = [ | 79 | $entries[] = [ |
80 | 'url' => $data[0], | 80 | 'url' => $data[0], |
81 | 'title' => $data[1], | 81 | 'title' => $data[1], |
82 | 'status' => $data[3], | ||
83 | 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], | 82 | 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], |
84 | 'is_starred' => 'Starred' === $data[3], | 83 | 'is_starred' => 'Starred' === $data[3], |
85 | 'html' => false, | 84 | 'html' => false, |
@@ -94,6 +93,10 @@ class InstapaperImport extends AbstractImport | |||
94 | return false; | 93 | return false; |
95 | } | 94 | } |
96 | 95 | ||
96 | // most recent articles are first, which means we should create them at the end so they will show up first | ||
97 | // as Instapaper doesn't export the creation date of the article | ||
98 | $entries = array_reverse($entries); | ||
99 | |||
97 | if ($this->producer) { | 100 | if ($this->producer) { |
98 | $this->parseEntriesForProducer($entries); | 101 | $this->parseEntriesForProducer($entries); |
99 | 102 | ||
@@ -147,7 +150,7 @@ class InstapaperImport extends AbstractImport | |||
147 | ); | 150 | ); |
148 | } | 151 | } |
149 | 152 | ||
150 | $entry->setArchived($importedEntry['is_archived']); | 153 | $entry->updateArchived($importedEntry['is_archived']); |
151 | $entry->setStarred($importedEntry['is_starred']); | 154 | $entry->setStarred($importedEntry['is_starred']); |
152 | 155 | ||
153 | $this->em->persist($entry); | 156 | $this->em->persist($entry); |