2016-09-21 15:47:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wallabag\ImportBundle\Import;
|
|
|
|
|
|
|
|
class ChromeImport extends BrowserImport
|
|
|
|
{
|
|
|
|
protected $filepath;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return 'Chrome';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getUrl()
|
|
|
|
{
|
|
|
|
return 'import_chrome';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getDescription()
|
|
|
|
{
|
|
|
|
return 'import.chrome.description';
|
|
|
|
}
|
2016-09-26 05:30:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function prepareEntry(array $entry = [])
|
|
|
|
{
|
|
|
|
$data = [
|
|
|
|
'title' => $entry['name'],
|
|
|
|
'html' => '',
|
|
|
|
'url' => $entry['url'],
|
|
|
|
'is_archived' => $this->markAsRead,
|
|
|
|
'tags' => '',
|
|
|
|
'created_at' => substr($entry['date_added'], 0, 10),
|
|
|
|
];
|
|
|
|
|
|
|
|
if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
|
|
|
|
$data['tags'] = $entry['tags'];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2016-09-21 15:47:47 +00:00
|
|
|
}
|