Cover Foto

bookmarklets-for-hubzilla

bookmarklets-for-hubzilla@im.allmendenetz.de

Channel Apps
Bookmarklet Maker
Hubzilla Bookmarklet Maker

  • Drag and drop bookmaklet install button: put-in-name-for-your-bookmarklet
  • Output:
  • Html code:


Usage:


  1. - Click the button  Clear  to clear the input forms. 

  2. - Put in a name for your bookmarklet in the field "Name your bookmarklet".

  3. - Look further down on this page and select a bookmarklet code snippet for your Hubzilla channel and copy it to the clipboard by clicking the  Copy  button.

  4. - Paste a selected bookmarklet code snippet by Ctrl-V / Strg-V from the clipboard to into the form field "Code".

  5. - Edit the code by putting in YOUR-HUB-DOMAIN.TLD and YOUR-CHANNEL-NICKNAME and click on the button  Generate Bookmarklet .

  6. - To test the bookmarklet click on the  Run Code  button.

  7. - To install the bookmarklet drag and drop the button  "Drag and drop bookmaklet install button" to the toolbar or the bookmark sidebar of your browser.

  8. - Redo this possess for every bookmaklet you like to install

  9. DONE



See also this HowTo video:




Bookmarklet code snippets for your Hubzilla channel:

Web-article clipper
Selected/marked text clipper
Bookmark URL and title
Search selected/marked text
Diverse

 

📕 Submit entire web-article as markdown text to your /channel page:

const
	base64 = x => btoa(unescape(encodeURIComponent(x))),
	onload = x => {
		if (!Readability || !TurndownService) return;
		
		const content = new Readability(document.cloneNode(true)).parse().content,
			text = new TurndownService().turndown(content) 
				+ `\n\n[original]: ${document.location.href} "${document.title}"\n`,
			link = document.createElement('a');
		
	var selectedText = window.getSelection().toString();
	var currentUrl = document.URL;
	var hubzillaText = text ? '[quote]' + text + '[/quote]' + 'SOURCE:' + ' ' + currentUrl : currentUrl ;
	var title = document.title;
	window.open('https://YOUR-HUB-DOMAIN.TLD/rpost?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');
	},
	
require = x => document.head.append(Object.assign(document.createElement('script'),{src:x,onload:onload}));

require('//cdn.jsdelivr.net/npm/@mozilla/readability/Readability.min.js');
require('//cdn.jsdelivr.net/npm/turndown/dist/turndown.min.js');


📗 Submit entire web-article as markdown text to your /articles page (articles app):

const
	base64 = x => btoa(unescape(encodeURIComponent(x))),
	onload = x => {
		if (!Readability || !TurndownService) return;
		
		const content = new Readability(document.cloneNode(true)).parse().content,
			text = new TurndownService().turndown(content) 
				+ `\n\n[original]: ${document.location.href} "${document.title}"\n`,
			link = document.createElement('a');

		var currentUrl = document.URL;
		var hubzillaText = text ? text + 'SOURCE:' + ' ' + currentUrl : currentUrl ;
		var title = document.title;
		window.open('https://YOUR-HUB-DOMAIN.TLD/articles/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');
	},
	
require = x => document.head.append(Object.assign(document.createElement('script'),{src:x,onload:onload}));

require('//cdn.jsdelivr.net/npm/@mozilla/readability/Readability.min.js');
require('//cdn.jsdelivr.net/npm/turndown/dist/turndown.min.js');


📘 Submit entire web-article as markdown text to your /cards page (cards app):

const
	base64 = x => btoa(unescape(encodeURIComponent(x))),
	onload = x => {
		if (!Readability || !TurndownService) return;
		
		const content = new Readability(document.cloneNode(true)).parse().content,
			text = new TurndownService().turndown(content) 
				+ `\n\n[original]: ${document.location.href} "${document.title}"\n`,
			link = document.createElement('a');

		var currentUrl = document.URL;
		var hubzillaText = text ? text + 'SOURCE:' + ' ' + currentUrl : currentUrl ;
		var title = document.title;
		window.open('https://YOUR-HUB-DOMAIN.TLD/cards/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');
	},
	
require = x => document.head.append(Object.assign(document.createElement('script'),{src:x,onload:onload}));

require('//cdn.jsdelivr.net/npm/@mozilla/readability/Readability.min.js');
require('//cdn.jsdelivr.net/npm/turndown/dist/turndown.min.js');


📙 Submit entire web-article as markdown text to your /webpages page (webpages app):

const
	base64 = x => btoa(unescape(encodeURIComponent(x))),
	onload = x => {
		if (!Readability || !TurndownService) return;
		
		const content = new Readability(document.cloneNode(true)).parse().content,
			text = new TurndownService().turndown(content) 
				+ `\n\n[original]: ${document.location.href} "${document.title}"\n`,
			link = document.createElement('a');

		var currentUrl = document.URL;
		var hubzillaText = text ? text + 'SOURCE:' + ' ' + currentUrl : currentUrl ;
		var title = document.title;
		window.open('https://YOUR-HUB-DOMAIN.TLD/webpages/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');
	},
	
require = x => document.head.append(Object.assign(document.createElement('script'),{src:x,onload:onload}));

require('//cdn.jsdelivr.net/npm/@mozilla/readability/Readability.min.js');
require('//cdn.jsdelivr.net/npm/turndown/dist/turndown.min.js');


🌟 Submit selected/marked text to your /channel page:

var selectedText = window.getSelection().toString();
var currentUrl = document.URL;
var hubzillaText = selectedText ? '[quote]' + selectedText + '[/quote]' + ' ' + currentUrl : currentUrl ;
var title = document.title;
window.open('https://YOUR-HUB-DOMAIN.TLD/rpost?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');


⭐ Submit selected/marked text to your /articles (articles app):

var selectedText = window.getSelection().toString();
var currentUrl = document.URL;
var hubzillaText = selectedText ? '[quote]' + selectedText + '[/quote]' + ' ' + currentUrl : currentUrl ;
var title = document.title;
window.open('https://YOUR-HUB-DOMAIN.TLD/articles/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');


☀️ Submit selected/marked text to your /cards (cards app):

var selectedText = window.getSelection().toString();
var currentUrl = document.URL;
var hubzillaText = selectedText ? '[quote]' + selectedText + '[/quote]' + ' ' + currentUrl : currentUrl ;
var title = document.title;
window.open('https://YOUR-HUB-DOMAIN.TLD/cards/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');


✨ Submit selected/marked text to /webpages (webpage-app):

var selectedText = window.getSelection().toString();
var currentUrl = document.URL;
var hubzillaText = selectedText ? '[quote]' + selectedText + '[/quote]' + ' ' + currentUrl : currentUrl ;
var title = document.title;
window.open('https://YOUR-HUB-DOMAIN.TLD/webpages/YOUR-CHANNEL-NICKNAME?body=' + encodeURIComponent(hubzillaText) + '&title=' + encodeURIComponent(title), '_blank');


⚡ Submit page title and url to /rbmark (bookmark-app):  

var url= location.href;
var title = document.title || url;
window.open('https://YOUR-HUB-DOMAIN.TLD/rbmark?&url=' + encodeURIComponent(url)+'&title=' + encodeURIComponent(title)+'&source=bookmarklet','_blank');


🔍 Submit selected/marked text to search under /channel:

var selectedText = window.getSelection().toString();
var hubzillaText = selectedText ? selectedText + ' ' : ' ' ;
window.open('https://YOUR-HUB-DOMAIN.TLD/channel/YOUR-CHANNEL-NICKNAME?search=' + encodeURIComponent(hubzillaText) , '_blank');


🔍 Submit selected/marked text to search under /network:

var selectedText = window.getSelection().toString();
var hubzillaText = selectedText ? selectedText + ' ' : ' ' ;
window.open('https://YOUR-HUB-DOMAIN.TLD//network?search=' + encodeURIComponent(hubzillaText) , '_blank');


📊 Statistic - count characters :

var selectedText = window.getSelection().toString();
const text = document.body.innerText; const words = text.trim().split(/\s+/).filter(word => word.length > 0); const characters = text.length; const charactersNoSpaces = text.replace(/\s/g, '').length; const stats = `📊 Page Statistics: Words: ${words.length.toLocaleString()} Characters: ${characters.toLocaleString()} Characters (no spaces): ${charactersNoSpaces.toLocaleString()}`; alert(stats);