12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class DeliciousBookmarkImporter extends QueueHandler
- {
-
- function transport()
- {
- return 'dlcsbkmk';
- }
-
- function handle($data)
- {
- $profile = Profile::getKV('id', $data['profile_id']);
- try {
- $saved = Bookmark::saveNew($profile,
- $data['title'],
- $data['url'],
- $data['tags'],
- $data['description'],
- array('created' => $data['created'],
- 'distribute' => false));
- } catch (ClientException $ce) {
-
- common_log(LOG_ERR, "Error importing delicious bookmark to $data[url]: " . $ce->getMessage());
- return true;
- } catch (Exception $ex) {
- if (preg_match("/DB Error: already exists/", $ex->getMessage())) {
- common_log(LOG_ERR, "Error importing delicious bookmark to $data[url]: " . $ce->getMessage());
- return true;
- } else {
- throw $ex;
- }
- }
- return true;
- }
- }
|