del.icio.us sync in devonthink

Glad it was helpful. As far as I know, type nexus has been depreciated since DTP 1.1.

Ah, simple is surely better. I like it.

Dear Christian, your script is making me use DT so much more! It should be included in the scripts shipped with DT.

Right now the script imports only the bookmarks, but not the “tags” and the “notes” fields.

There is any chance the script could be updated to import also those two extra del.icio.us fields associated with each bookmark (or at least the tags field)? They could be inserted as 2 separate lines in the comment field of each imported link, for example:

emacs library
Emacs Planner Mode by sacha chua.

The very best would be to reimport a link if any of the del.icio.us fields are different from the values present in the del.icio.us folder in DT (right now if the title of a link is changed on del.icio.us, the change will not show up next time the script is run)

This resource could help: del.icio.us/help/api/posts

By preserving all the information so laboriously created there, DT users would have the best of both worlds. Del.icio.us is one the most popular social bookmarking available, and I am sure such improvements would help DT evangelism as well!

Thank you so much, Christian.

Hi

I had a problem running the script:
“Expected end of line but found identifier.”

The line is:
display alert “DEVONthink Pro” message error_message as warning

and it is highlighting the word “alert”.

Any ideas please?

Thanks.

Rich

You’re probably still running Mac OS X 10.3.9, just replace…


   on error error_message number error_number 
      if the error_number is not -128 then 
         try 
            display alert "DEVONtink Pro" message error_message as warning 
         on error number error_number 
            if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1 
         end try 
      end if 
   end try 

…with…


   on error error_message number error_number 
      if the error_number is not -128 then 
display dialog error_message buttons {"OK"} default button 1 
      end if 
   end try 

Anyway to have it save Web Archives in DevonThink instead of bookmarks? Would that just be absurd?

That should be possible (see script “Add web archive to DEVONthink” for Safari for example) but I’m not sure if this make sense.

Hello,

I am still in my DT-pro experimental phase and don’t have any Applescript knowledge…
So I already tried this updated script:



-- Import del.icio.us bookmarks 
-- Created by Christian Grunenberg on Mon Jan 23 2006. 
-- Copyright (c) 2006. All rights reserved. 

property pUser : "" 
property pPassword : "" 

tell application "DEVONthink Pro" 
   try 
      set theURLs to {} 
      set theNames to {} 
       
      set theXML to download markup from "http://del.icio.us/api/posts/all" user pUser password pPassword encoding "UTF-8" 
       
      if theXML is not "" then 
         set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "href=\""} 
         set theHrefs to text items 2 thru -1 of theXML 
         set AppleScript's text item delimiters to "\"" 
         repeat with theHref in theHrefs 
            set theURLs to theURLs & (text item 1 of theHref) 
         end repeat 
          
         set AppleScript's text item delimiters to "description=\"" 
         set theDescriptions to text items 2 thru -1 of theXML 
         set AppleScript's text item delimiters to "\"" 
         repeat with theDescription in theDescriptions 
            set theNames to theNames & (text item 1 of theDescription) 
         end repeat 
         set AppleScript's text item delimiters to od 
          
         if (count of theURLs) is equal to (count of theNames) then 
            set theGroup to create location "del.icio.us" 
            set theCnt to (count of theURLs) 
            repeat with i from 1 to theCnt 
               set theURL to (item i of theURLs) 
               set theName to (item i of theNames) 
               if not (exists record with URL theURL in theGroup) then 
                  create record with {name:theName, type:link, URL:theURL} in theGroup 
               end if 
            end repeat 
         else 
            error "Unknown error." 
         end if 
      else 
         error "Download failed." 
      end if 
   on error error_message number error_number 
      if the error_number is not -128 then 
         try 
            display alert "DEVONtink Pro" message error_message as warning 
         on error number error_number 
            if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1 
         end try 
      end if 
   end try 
end tell 

And this worked out fine just until now.
I created a new database and now i got the error message:
Devontink Pro Download failed

I then tried the script I found here:
http://www.devon-technologies.com/phpBB2/viewtopic.php?t=2984&highlight=del+ici+ous
After asking for my username and password, the result is the same error message.
What could I have done wrong that these scripts no longer work?

Thanks,
I learn a lot from this user community.
Tom

Looks like Yahoo has changed the URL to the API, just use “https://api.del.icio.us/v1/posts/all” instead of “http://del.icio.us/api/posts/all”.

Thank you so much.
Downloading works again in both scripts.
Only this time, the ‘sync’ isn’t complete. Not all ‘delicious’ bookmarks were downloaded.

Tom

The script downloads only those which are not already part of your database.

Ok, I’m up and running again.
Thanks

Tom

So many times it happens that one of the bookmarked resources I have painstakingly listed in my del.icio.us account disappear from the Internet for good. Then I blame myslef for not having captured the page in my DT database. :cry:

It would very nice (and so convenient!) to automatically capture in a separate folder all the pages pointed by the links in my del.icio.us folder.

I searched through this Forum’s archives, but I could not find any help on how to go about that very useful functionality.

Could anybody advice or point me to some resource?

Just have a look at the script posted in this thread to convert bookmarks to web archives:

http://www.devon-technologies.com/phpBB2/viewtopic.php?t=2475

Wow, thank you for the immediate reply! That is exactly was I was looking for.
In that thread you mention there is a “1.1.2beta5” version. I would be glad to enroll as a beta tester. Is that possible at all?

Thank you once again.

We’ll release a new version soon but if you’re a registered user of DT Pro and willing to sign an NDA, then just drop me an email.

I am trying to use this script. It runs fine, but the if statement that traps for empty xml is firing every time, so I get “Download failed.”

I switched to the new URL listed above, and got the same error.

If I go to that URL in my browser, I get the xml payload fine from del.icio.us.

Any thoughts you might have on additional troubleshooting steps would be greatly appreciated.

You could specify the pUser and pPassword properties to ensure that this information is correct (maybe the keychain contains multiple/outdated keys for del.icio.us).

That worked, thanks for the help