please help me fix my code!
March 8, 2007 6:41 AM   RSS feed for this thread Subscribe

delicious java bookmarklet help

ok, trying to make a simple search bookmarklet for delicious that will search only my tags without using plus signs in the tag entry box. see the code below

javascript:user='twx';void(multitag=prompt('Add%20Tag1+Tag2+Tag3','));{location='http://del.icio.us/'+user+'/'+multitag};

I would like to be able search tags like this: music vinyl
rather than the curent method: music+vinyl

I know nothing about Java and cannot find an easy fix :-( Any help is greatly appreciated!
posted by sil3ntstatic to computers & internet (7 comments total) 1 user marked this as a favorite
First (and someone has to mention it) Java != javascript and this is javascript.


javascript:user='twx';void(multitag=prompt('Add%20Tag1%20Tag%20 Tag3','));{location='http://del.icio.us/'+user+'/'+escape(multitag)}

I believe that will do what you want though I'm not sure delicious will support it.
posted by bitdamaged at 6:51 AM on March 8, 2007


javascript:user='twx';void(multitag=prompt('Add%20Tag1%20Tag%20Tag3'));{location='http://del.icio.us/'+user+'/'+escape(multitag)}

There that actually works
posted by bitdamaged at 6:55 AM on March 8, 2007


oops, see i told you i didnt know a thing about java(scripts) :-P

Ok, tried both and they didnt work. However, the second instance did search by 'music vinyl' rather than searching the combination of the two tags 'music' and 'vinyl' - in the original code (that uses the + symbols) it does search within the tags

hope that makes sense

I used to have it down perfect so i know it can be done and that delicious does support it!

Many thanks in advance!
posted by sil3ntstatic at 7:19 AM on March 8, 2007


javascript:user='twx';void(multitag=prompt('Add%20Tag1%20Tag%20Tag3'));{location='http://del.icio.us/search/?fr=del_icio_us&p='+escape(multitag)+'&type=user'}

How about that?
posted by zemblamatic at 7:55 AM on March 8, 2007


Yay! That is perfect, thank you very much!
posted by sil3ntstatic at 8:00 AM on March 8, 2007


>see i told you i didnt know a thing about java(scripts)

Please! Java is one language, Javascript is another! This is not a "Java script".
posted by AmbroseChapel at 12:15 PM on March 8, 2007


I wrote a more general version of what you are describing a whlie back. Specifically I wrote a bookmarklet that creates other bookmarklets which can interpolate multiple parameters. Although it was written for Firefox (or was it Mozilla back then?) in 2003 it still seems to work. It was submitted to Bugzilla (bug 124237) but never adopted. Oh well, I use it and maybe you can too.

After creating a new bookmarklet and assigning a keyword to it (I use 'mmab' == 'make multiple-argument bookmarklet'), it's used as follows:

1) from the URL bar, type mmab
2) You will be prompted for a URL template. Take an example URL and replace each parameter of interest with %s, for example
http://finance.yahoo.com/q/bc?s=CSCO&t=3m
becomes
http://finance.yahoo.com/q/bc?s=%s&t=%s
3) After making these changes, enter a name for the bookmarklet when prompted.
4) A new page appears with a link to the newly created bookmarklet.
5) Add the link to your bookmarks and assign it a keyword, 'sq' for stock quote for example.
6) Now from the URL bar you can invoke the new bookmarklet with
sq csco 3m
sq msft 1d
etc.

I would like to pre-emptively state that the code probably sucks rocks because that was my first and only foray into JavaScript. You can find the code as the last attachment (as of today) to the above-linked bug.

posted by harmfulray at 3:29 PM on March 8, 2007


« Older Where in the States (or UK) ca...   |   How to grow a spine.... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Learning Programming/Logic/Algorithms by Yourself... April 24, 2008
Coffee Drinks beyond the Basics January 20, 2008
How to teach myself computer science? January 12, 2008
What web design language should I learn? December 5, 2006
I Want My, I Want My, I Want My Cmd-1 ... December 6, 2005