Hi, I would like to create a bookmarklet that users could install so they can automatically post stories to my site while they are searching the web...

I know there is the code provided to use in the bookmarklet, but how do you actually create it??

Thanks

Comments

frjo’s picture

Select the code and drag it to the bookmarkbar, or if you stucked with Internet Explorer, right click on it and add it as a favorite. It just a normal bookmark that happens to contains some JavaScript.

To make it easy for users you can add it as a link to your page, like I have done on http://vigillar.se/help/buttons (in Swedish but you get the picture). Like this:

bookmarklet

<a href="javascript:location.href='http://www.example.com/node/add/storylink?edit[url]='+encodeURIComponent(location.href)+'&edit[title]='+encodeURIComponent(document.title)">bookmarklet</a>
patchak’s picture

Thanks, I'll try that!!!

frjo’s picture

Status: Active » Fixed
patchak’s picture

Status: Fixed » Active

The bookmarklet does not seem to work with internet explorer, any ideas about that?

Thanks

patchak’s picture

Should add that the exact same code works with firefox.. any ideas?
Thanks

shadyman@erroraccessdenied.com’s picture

Did you change example.com to the address of your site?

formicin’s picture

Status: Closed (fixed) » Active

It works fine in IE6, can you state your version of IE?

kollega’s picture

It seems to me that I have problems with ampersands (&).
If i use address http://www.example.com/?module=news&id=17 we'll have with
http://www.example.com/?id=1&amp;module=news

&amp; - looks not correct!

mstef’s picture

I just posted a bug regarding this. If the person who clicks the bookmarklet is not logged in there is no way they can submit the link. Unless they login then go back to the other site then press it and come back, etc. I have been trying to fix this for the past 5 hours and nothing..

Help?

mstef’s picture

I had to create a php hack with the user login system to get this to work. If anyone is interested...

patchak’s picture

Mikestefff: could you post your fix to allow people to use the boormarklet even when they are not logged into the site??
Thanks,

Patchak

unodewaal’s picture

Yeah I'd like to see the bookmarklet work as well!

unodewaal’s picture

I've gotten my bookmarklet to work fine, but if I want it to popup in a new window, how do I do that? My current code for the bookmarklet is:

javascript:location.href='http://evo/social/?q=node/add/weblink&edit[links_weblink_url]='+encodeURIComponent(location.href)+'&edit[title]='+encodeURIComponent(document.title)+'&edit[body]='+window.getSelection()

thanks

kirkcaraway’s picture

Has anyone made this bookmarklet hack work? If so, please pass along how you did it. Thanks.

alexandreracine’s picture

Status: Active » Closed (fixed)

Cleaning a little...

4.x versions are not supported anymore.

-You can upgrade
-You can sponsor future developpement of this module (look on the related pages on drupal.org)
-Reopen if needed.

fadgadget’s picture

I hope you dont mind me reopening this as it's the only place ive actually seen a hint of an answer to my question.

I have made a bookmarklet which you can view in a block at the bottom of this page-
http://onlinebanter.com/web2ob

My code is this-

<a href="javascript:u=document.location.href;t=document.title;s=window.getSelection();void(window.open("http://onlinebanter.com/node/add/web2ob?edit[title]="+escape(t)+'&edit[body_field][body]='+escape(s)+'&edit[field_link][0][url]='+escape(u),'_blank','width=600,height=500,status=yes,resizable=yes,scrollbars=yes'));">bookmarklet</a>

but when i try to add that to my browser by dragging it it ruins all the code in my brwoser favourite to this-

javascript:u=document.location.href;t=document.title;s=window.getSelection();void(window.open(

and thus my bookmarklet doesnt work. if i edit my bookmark code though manually and add the 1st bit of code i posted here in my browser favourites without the HTML obviously it works well. I have my block on Full HTML with no filters etc. This has been a problem for me for nearly a year now and ive asked about it in various places about the net.

Can anyone help with this? Please and thanks

Ross

fadgadget’s picture

ps i am using the Prepopulate Drupal Module to help me use the code above.

alexandreracine’s picture

Status: Active » Closed (won't fix)

Cleaning...
Still valid?
Version 4.?