User talk:JesseW/BookmarkletsUniversal

Here's the Emacs regex's I used to make this: (Replace philburns address with the approprite site, of couse.)

Replace regexp ^\(.+\)\(javascript:.+\)QBREAKQ\(.+\)$ with: ====\1==== \2 &lt;/pre&gt;
 * &lt;pre&gt;
 * Description : \3
 * From : http://www.philburns.com/bookmarklets.html

To generate the data, I used a bookmarklet(-) ), which is here. If you have any questions, please ask me. JesseW 03:56, 4 Dec 2004 (UTC)

Putting each bookmarklet on one line (for sorting)
Here's Emacs code I wrote to put each bookmarklet on one line. (defun toggle-real-newlines "Toggles newlines turning into fake newlines, and back." (interactive) (save-excursion (let ((fakenl "@This is a newline@"))   (beginning-of-buffer) (if (search-forward fakenl nil t) 			    (progn (beginning-of-buffer) 				   (replace-string fakenl "\n")) (progn (beginning-of-buffer) 				 (replace-string "\n" fakenl))))))

(defun toggle-uniline-sections (replacement) "Makes everything into one line, divided by `replacement`.

`replacement` should include %s, which is replaced with a real or fake newline as appropriate. Uses toggle-real-newlines." (interactive "MReplacement: ")  (save-excursion     (let* ((fakenl "@This is a newline@") 	  (rep-real (format replacement "\n"))	  (rep-fake (format replacement fakenl)))      (beginning-of-buffer)       (if (search-forward fakenl nil t) 	  (progn (beginning-of-buffer) (replace-string rep-real rep-fake)		 (toggle-real-newlines))	(progn (toggle-real-newlines)	       (beginning-of-buffer) (replace-string rep-fake rep-real))))))
 * Written on Tue Dec 7 14:02:46 2004

(defun toggle-uniline-universal-bookmarklets-page "Makes each bookmarklet (and section title) into one line." (interactive) (toggle-uniline-sections "%s===")) Feel free to ask me if you have any questions about it. JesseW 22:10, 7 Dec 2004 (UTC)
 * Written on Tue Dec 7 13:49:10 2004

Partial solution to getting subsimple's bookmarklets imported here
(defun doit "Function to organize stuff from subsimple. Sort-of-works." (interactive)  (beginning-of-buffer)  (replace-regexp " +" "BOOKMARKLET_BEGIN_QQ")  (beginning-of-buffer)  (replace-query-regexp " +  \(.+\) " "BOOKMARKLET_NAME:\1")  (beginning-of-buffer)  (replace-string "\n    " " ")  (beginning-of-buffer)  (replace-regexp "\(.+?\)" "[\1 \2]")  (beginning-of-buffer)  (replace-regexp " \n" " ")  (beginning-of-buffer)  (replace-regexp " " "\nBOOKMARKLET_DESCRIP:")  (beginning-of-buffer)  (replace-regexp "" "\nBOOKMARKLET_CODE:")  (beginning-of-buffer)  (replace-regexp ".+" "REALCODE: javascript:\1")  (beginning-of-buffer)  (replace-regexp "^[\n ]+$" "")  (beginning-of-buffer)  (replace-string "\n\n" "\n")  (beginning-of-buffer) (replace-string "BOOKMARKLET_CODE:\n" "BOOKMARKLET_CODE:") (beginning-of-buffer) (replace-regexp "^[^A-Z].+$" "") ;; delete any lines not beginning with A-Z (beginning-of-buffer) (replace-string "\n\n" "\n") (beginning-of-buffer)) This is mainly just saved here for my convinence.