├── $__ak_plugins_EasyBookmark.json ├── README.md └── images ├── .empty └── EasyBookmark_NewBookmark.png /$__ak_plugins_EasyBookmark.json: -------------------------------------------------------------------------------- 1 | [{"text":"{\n \"tiddlers\": {\n \"$:/ak/plugins/EasyBookmark/newBookmark.js\": {\n \"text\": \"/*\\\\\\ntitle: $:/ak/plugins/EasyBookmark/newBookmark.js\\ntype: application/javascript\\nmodule-type: macro\\n\\n\\n<>\\n\\nExample to get title from google <>\\n\\n\\n\\\\*/\\n\\n(function(){\\n\\n\\n\\\"use strict\\\";\\n\\n\\n\\nexports.name = \\\"newBookmark\\\";\\n\\n\\nexports.params = [{name: \\\"url\\\"},{name: \\\"includeScreenshot\\\"}, {name: \\\"APIKey\\\"}];\\n\\n/*\\nRun the macro\\n*/\\n\\nexports.run = function(url, includeScreenshot, APIKey) {\\n\\n var url = encodeURI(url) || \\\"None\\\";\\n var includeScreenshot = includeScreenshot || \\\"no\\\";\\n var tiddlerTitle = \\\"None\\\";\\n var tiddlerText = \\\"None\\\";\\n var APIKey = APIKey || \\\"None\\\";\\n\\n console.log(\\\">>>>>>>>>>>>>>>>>> \\\" + APIKey + \\\"<<<<<<<<<<<<<<<<<<\\\");\\n\\n $tw.utils.httpRequest({url: \\\"http://textance.herokuapp.com/title/\\\"+url, type: \\\"POST\\\", callback: function (error,data){\\n if (error){\\n console.log(\\\"ERROR:\\\"+error);\\n }\\n tiddlerTitle = data;\\n tiddlerText = url;\\n\\n if(includeScreenshot == \\\"yes\\\"){\\n tiddlerText += \\\"
[img[https://api.apiflash.com/v1/urltoimage?access_key=\\\" + APIKey + \\\"&url=\\\" + url + \\\"]] \\\";\\n }\\n $tw.wiki.addTiddler({title:tiddlerTitle, text:tiddlerText});\\n console.log(\\\">>>>>>>>>>>>>>>>>> \\\" + tiddlerText + \\\"<<<<<<<<<<<<<<<<<<\\\");\\n }}) \\n\\n return \\\"[[\\\"+tiddlerTitle +\\\"]]\\\";\\n};\\n\\n\\n})();\",\n \"bag\": \"default\",\n \"revision\": \"5\",\n \"type\": \"application/javascript\",\n \"title\": \"$:/ak/plugins/EasyBookmark/newBookmark.js\",\n \"tags\": \"\",\n \"module-type\": \"macro\",\n \"modified\": \"20200426104958801\",\n \"created\": \"20200425195727700\"\n },\n \"$:/ak/plugins/EasyBookmark/state/newBookmark\": {\n \"text\": \"\",\n \"bag\": \"default\",\n \"revision\": \"41\",\n \"url\": \"\",\n \"type\": \"text/vnd.tiddlywiki\",\n \"title\": \"$:/ak/plugins/EasyBookmark/state/newBookmark\",\n \"modified\": \"20200426150735454\",\n \"includescreenshot\": \"yes\",\n \"created\": \"20200425203503662\",\n \"apikey\": \"\"\n },\n \"$:/ak/plugins/EasyBookmark/change.log\": {\n \"created\": \"20200426105656669\",\n \"text\": \"\\\"\\\"\\\"\\n''2020-04-26'': v0.0.4\\n* added URL encoding as per herokuapp.com api documentation\\n* tagged [[New Bookmark]] as $:/tags/SideBar to make it show as per Mohammad Suggestion\\n''2020-04-25'': v0.0.2 initial release\\n\\\"\\\"\\\"\",\n \"bag\": \"default\",\n \"revision\": \"4\",\n \"type\": \"text/vnd.tiddlywiki\",\n \"title\": \"$:/ak/plugins/EasyBookmark/change.log\",\n \"modified\": \"20200426152945933\"\n },\n \"New Bookmark\": {\n \"text\": \"\\\\define new-Bookmark()\\n<>\\n\\\\end\\n\\n<$edit-text class='tc-edit-texteditor' tiddler='$:/ak/plugins/EasyBookmark/state/newBookmark' field='url' placeholder='Bookmark URL ~include http(s)://~'/>
\\n\\n<$checkbox tiddler='$:/ak/plugins/EasyBookmark/state/newBookmark' field=\\\"includescreenshot\\\" checked=\\\"yes\\\" unchecked=\\\"no\\\" default=\\\"yes\\\"> Include a screenshot?\\n\\n<$reveal type=\\\"match\\\" state=\\\"$:/ak/plugins/EasyBookmark/state/newBookmark!!includescreenshot\\\" text=\\\"yes\\\">\\n\\n<$edit-text class='tc-edit-texteditor' tiddler='$:/ak/plugins/EasyBookmark/state/newBookmark' field='apikey' placeholder='Your apiflash.com API Key'/>
\\n\\n\\n\\n\\n<$set name=\\\"extUrl\\\" value={{$:/ak/plugins/EasyBookmark/state/newBookmark!!url}} >\\n<$set name=\\\"includeScreenshot\\\" value={{$:/ak/plugins/EasyBookmark/state/newBookmark!!includescreenshot}}>\\n<$set name=\\\"APIKey\\\" value={{$:/ak/plugins/EasyBookmark/state/newBookmark!!apikey}}>\\n<$button actions=<>>\\n<$action-setfield $tiddler='$:/ak/plugins/EasyBookmark/state/newBookmark' url='' includescreenshot='' />\\nCreate Bookmark\\n\\n\\n\\n\\n\\n\\n\",\n \"bag\": \"default\",\n \"revision\": \"1\",\n \"type\": \"text/vnd.tiddlywiki\",\n \"title\": \"New Bookmark\",\n \"tags\": \"$:/tags/SideBar\",\n \"modified\": \"20200426105151553\",\n \"created\": \"20200425165640168\"\n }\n }\n}","bag":"default","revision":"2","version":"0.0.4","type":"application/json","title":"$:/ak/plugins/EasyBookmark","plugin-type":"plugin","name":"EasyBookmark","modified":"20200426153028245","description":"Easily Create Bookmarks","dependents":"","created":"20200425195410697"}] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TiddlyWiki-EasyBookmark 2 | 3 | A TiddlyWiki bookmarking plugin that has for goal to create a **Bookmark** Tiddler by simply copy/paste the URL in a textbox 4 | 5 | # Features: 6 | * Create tiddler by copy / paste of a URL 7 | * Can include a screenshot for the webpage thanks to __https://apiflash.com/__ API (get your API key for free) 8 | 9 | # Change log 10 | ***2020-04-26***: v0.0.4 11 | * added URL encoding as per herokuapp.com api documentation 12 | * tagged New Bookmark as $:/tags/SideBar to make it show as per Mohammad Suggestion 13 | **2020-04-25**: v0.0.2 initial release 14 | 15 | # Installation 16 | Download the [JSON file](https://github.com/akhater/TiddlyWiki-EasyBookmark/blob/master/%24__ak_plugins_EasyBookmark.json) and drag/drop it in your TiddlyWiki 17 | 18 | # Usage 19 | 1. Go to your __New Bookmark__ Tiddler 20 | 2. Paster the URL you want to bookmark *including* http(s):// 21 | 3. Select *include a screenshot* if you want 22 | 4. add your *apiflash.com* API key for screenshot processing 23 | 5. click on *Create Bookmark* 24 | ![](images/EasyBookmark_NewBookmark.png) 25 | 26 | # Credits 27 | * **__https://apiflash.com/__** for the free API for screenshots 28 | * **__http://textance.herokuapp.com/__** for the free API to retreive website title 29 | * **[TiddlyWiki community](https://groups.google.com/forum/#!forum/tiddlywiki)** 30 | * **[inmysocks](http://inmysocks.tiddlyspot.com/#New%20Tiddler%20Form)** for showing me how to use forms 31 | * **[Paulin Gjini](https://groups.google.com/forum/m/#!topic/tiddlywiki/E_X3KUHOvEk)** for the inspiration on the .js script 32 | 33 | 34 | 35 | # Discussion 36 | https://groups.google.com/forum/#!topic/tiddlywiki/pr42e29nwU8 37 | 38 | # N.B. 39 | I am totally new to all this so take everything with a grain of salt :) 40 | -------------------------------------------------------------------------------- /images/.empty: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/EasyBookmark_NewBookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhater/TiddlyWiki-EasyBookmark/fe3be59c06f6590f2ad0377d6f36bbd25dee8b82/images/EasyBookmark_NewBookmark.png --------------------------------------------------------------------------------