I created a JavaScript bookmarklet that receives the current page's title and URL using the following code:
// If jQuery is already loaded, check to see if (jQuery type == 'undefined') {var jq = document.createElement ('script'); JQ.type = 'Text / JavaScript'; JQ.onload = runthis; JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; Document.body.appendChild (jq); } Else {runthis (); } // main javascript function function runthis () {title = document.title; Url = document.URL; Tag = "custom tag"; Warning ("Added to paperclip: page title:" + title + "| URL:" + url); } Now I want to take that information and add it as a bookmark to my delicious account. How can I go about this with javascript / jquery? I have seen on my side, but taking trouble on my head (completely new, and Oeth spin my head), and there can not be a complete code example to tinker with it.
In fact, any help / example would be appreciated.
edit:
- "I want to create a delicious bookmarket in Firefox which bookmarks the existing page with a predefined tag."
OK, an example that you really want using a bookmarklet in your browser's toolbar is a delicious bookmarklet. It collects information from the page, displays information in a popup, so you can edit it, and then store it in your account:
< Code> javascript: (function () {F = 'http://delicious.com/save?url=' + encodeurIComponent (window.location.href) + '& amp; title =' + encodeurIComponent (document.title) + '& Amp; v = 5 & amp;; A = function () {if (! Window.open (f +' noui = 1 & jump = doclose ',' deliciousuiv5 ',' location = yes, links = no (Scrollbars = no, toolbar = no, width = 550, height = 550 ')) location.href = f +' jump = yes'}; if (/ firefox. Test (navigator.useragent)) {setTimeout (a, 0)} and {A ()}}) If you use your Yahoo ID to log in, you have to use OAuth, but if you do not , You can use the V1 API in this way (from, Chrome has worked for me):
Javascript :( function () {location.href = 'https : // user: pwd@api.del.icio.us/v1/posts/add? Url = '+ encodeurIComponent (window.location.href) +' and description = '+ encodericoniconant +' and tag = obviostestag tag '; }} () Be sure to search your tags for "obvioustesttag" because it does not appear immediately in the chronological list.
Try to make a regular login or new account If you currently use YahooID to sign in, otherwise, you have to deal with OAuth.
Comments
Post a Comment