jarun / buku Goto Github PK
View Code? Open in Web Editor NEW:bookmark: Personal mini-web in text
License: GNU General Public License v3.0
:bookmark: Personal mini-web in text
License: GNU General Public License v3.0
Hi there !
First, thanks for your work, it's very promising !
I'm trying to make a small nodejs server that calls buku to retrieve my bookmarks. For simplicity, it would be great if buku could return the bookmarks formatted in json through a command line flag !
Thanks in advance
It imports the bookmarks.html
file as a single list. Exporting these bookmarks from buku
doesn't preserve the layout that was used in the originally exported bookmarks.html
file.
Is the lack of this feature intentional (part of the design) or could it be added in the future?
This is a ToDo list item to support in-place upgrade of the program.
Hi,
Some years ago, Opera has been refactored completely. I did not like how bookmarks were reorganised, so I went to use Buku for bookmarking. After feeding Opera's bookmarks into Buku, I attempted to use Buku with Opera. To force Buku to open bookmarks in Opera, I am exporting BROWSER=opera
. There are two generations of Opera I tried this with: Opera v12.16 (before the refactoring) and Opera v42 & v43 (recent). With the latter, when opening the bookmark of https://github.com/jarun/Buku, I am obtaining:
http://openurl%28https//github.com/jarun/Buku
[sic] is displayed;This site can't be reached / openurl%28https's server DNS address could not be found.
shows up.This makes it impossible for me to use Buku with a recent Opera. The %28 corresponds to the character (
: chr(0x28)
is (
. So it looks like that Buku is trying to tell Opera to openurl(https://github.com/jarun/Buku)
, however, it fails to do so. Nota bene that the colon :
is missing in the https//github.com/jarun/Buku
substring of the address bar content shown. I am not knowledgeable about how Buku instructs the browser of choice to open an URL. I am also not sure if the behaviour described here pertains to all users of Opera, or if it has something to do with my export BROWSER=opera
approach described above. Buku is working fine on my Arch Linux machine with both recent versions of Firefox as well as with the ancient Opera v12.16 when using the abovementioned BROWSER=[...]
method. So there are alternatives for me to using Buku with recent versions of Opera. However, I still would like to see this problem fixed to not have to work around it.
Friedrich
Continued from #39.
The list below is a growing one. While suggesting new features please consider contributing to Buku
. The code is intentionally kept simple and easy to understand with comments. We'll be happy to help out any new contributor.
Some of the just-completed features may not have been released yet. Grab the master branch for those.
This is the scratchpad I had with the envisioned endpoints:
get api/bookmarks/firefox.html # export to html
get api/bookmarks/firefox.md # export to markdown
get api/bookmarks #get all bookmarks
post api/bookmarks #new bookmark
delete api/bookmarks #delete table
post api/bookmarks/refresh #refresh all bookmarks
get api/bookmarks/search # get all bookmarks that match search
put api/bookmarks/search # update all bookmarks that match search
delete api/bookmarks/search # delete all bookmarks that match search
get api/bookmarks/:id # get bookmark with given id
put api/bookmarks/:id # update bookmark with given id
delete api/bookmarks/:id # delete bookmark with given id
post api/bookmarks/:id/refresh # refresh bookmark with given id
get api/bookmarks/:id/tiny # tinyurl of bookmark with given id
get api/bookmarks/:id/long # expanded url of bookmark with given id
get api/bookmarks/:id/:id # get bookmark in the given range
put api/bookmarks/:id/:id # update bookmark in the given range
delete api/bookmarks/:id/:id # delete bookmark in the given range
post api/bookmarks/:id/:id/refresh # refresh bookmark in the given range
get api/tags/ # get tags
put api/tags/:tag # replace tag
Edit: There are still things that are not yet clear, but I was thinking this was a good starting subset:
get api/bookmarks
post api/bookmarks
get api/bookmarks/:id
put api/bookmarks/:id
delete api/bookmarks/:id
get api/tags/
I often mistype the names of the tags and additional effort is required to correct them (if discovered)
It would be useful to have bash completion for tags
Hello,
When I add bookmarks, sometimes I get this error, and the entry is invalid
$ buku -a https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
297. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
EXCEPTION [add_bookmark]: (UnicodeEncodeError) 'ascii' codec can't encode character '\u2014' in position 37: ordinal not in range(128)
dstoica@pentoo ~ $
$ buku -s ''
297. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi [297]
Traceback (most recent call last):
File "/usr/local/bin/buku", line 1466, in
bdb.searchdb(args.sany, False, jsonOutput)
File "/usr/local/bin/buku", line 402, in searchdb
prompt(results)
File "/usr/local/bin/buku", line 891, in prompt
print_record(row, count)
File "/usr/local/bin/buku", line 931, in print_record
print(' \x1B[91m>\x1B[0m %s' % row[2])
UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' in position 37: ordinal not in range(128)
Hey guys,
is it possible to set the tags in the markdown-file? I just only discovered the syntax (title)[url]. Or maybe with html?
thanks for your help,
Hans
Hi there,
great work! Was searching a bit to get a quick workflow going to view/search/open bookmarks. Was going with buku-run as advised but found it already scraping the boundary of what poor old bash should be tasked with. Trying to extend it I was quickly in need to parse buku output.
With the pretty format being detrimental to stream processing, as it should be, I turned to JSON output and found that the index does not feature as a key. Although I am not sure I will really need it in the future I expect other people might.
Cheers
On OS X El Capitan, I installed buku via brew and core functionality seems to work: adding, deleting, searching, and opening web pages. However, I cannot lock or unlock the database.
$ buku -z -l
[DEBUG] Version 2.5
[ERROR] cryptography lib(s) missing
$ buku -z -k
[DEBUG] Version 2.5
[ERROR] cryptography lib(s) missing
It would be useful to have the option to add one or more tags to a record, without having to write the complete set of tags (along with -u / update command)
When adding a https url (https://www.example.com), urllib3 emits a warning that an Unverified HTTPS request is being made.
Buku version: 2.6
How to test:
$ buku -a https://www.example.com
Result:
$ buku -a https://www.example.com
/usr/lib/python3.5/site-packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
1. https://www.example.com
> Example Domain
Possible solutions:
urllib3.disable_warnings()
More information: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Would it be beneficial to verify the certificate or is it unnecessary?
I've recently installed Buku via Homebrew on OS X (zsh
version 5.0.8) and using the provided makefile on Fedora 24 (zsh
version 5.2). On both systems I get an error when trying to tab-complete:
_arguments:comparguments:313: invalid argument: (--merge){--merge}[merge another buku database]:buku db file
Deleting the line starting with "(--merge)" only causes the next line in the completion file to be reported. I came across a similar error with SVN completions, but the solution provided there was not helpful in case of Buku. I wonder if anyone else is experiencing this issue. I'm quite sure that its not my particular zsh configuration that's at fault, the error keeps popping out even when running a fresh shell with zsh --no-rcs
.
It's possible to do the following:
$ buku -a http://google.com
343. http://google.com
> Google
$ buku -a http://GOOGLE.com
344. http://GOOGLE.com
> Google
I would like to propose some sort of import functionality.
For those of us with a significant bookmark collection, it might be easier than starting from scratch. The chrome export format could be used, or something else which is easily accessible.
with the git version of buku writing of tags is not handled correctly
With version 2.0:
carnager@caprica ~ > buku -a http://www.catsthatlooklikehitler.com/cgi-bin/seigmiaow.pl "hitler, cats, fun"
Title: [Cats That Look Like Hitler!]
Added at index 106
106. http://www.catsthatlooklikehitler.com/cgi-bin/seigmiaow.pl
Cats That Look Like Hitler!
[TAGS] hitler, cats, fun
With checkout from git:
carnager@caprica ~ > /home/carnager/Buku/buku -a http://www.catsthatlooklikehitler.com/cgi-bin/seigmiaow.pl "hitler, cats, fun"
106. http://www.catsthatlooklikehitler.com/cgi-bin/seigmiaow.pl
> Cats That Look Like Hitler!
# cats, fun,hitler
Continued from #78.
The list below is a growing one. While suggesting new features please consider contributing to Buku
. The code is intentionally kept simple and easy to understand with comments. We'll be happy to help out any new contributor.
Some of the fresh-baked features may not have been released yet. Grab the master branch for those.
Is there any way to make this sync with Chrome/Firefox/etc without having to manually import/export after each change?
Thanks for this tool, very useful.
It would be great if it could filter entries as-you-typed, similar to peco, specially for those with very large collections.
It would be useful to delete multiple records at once:
When shortening the following URL:
https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/
we receive:
http://tny.im/HntZ2
which expands to
https://launchpad.net/~twodopeshaggy/archive/ubuntu/jarun/
Note the missing +
.
When there is more than one tag specified for deletion while deleting tags from all bookmarks, there is some (possibly) unintended behavior. The behavior is that not all tags specified are getting deleted.
I have only been able to replicate this when all of the following conditions are true:
It looks like if the string meets these conditions, then only the last tag in the string is deleted (last tag being the last one alphabetically, after input has been parsed and sorted). If the tag second-to-last in the order is found for a bookmark which also contains the last tag, then this penultimate tag is also deleted. However, if that penultimate tag exists for other bookmarks, those instances of the tag are not deleted.
Hi! I just installed buku from Homebrew on a mac running Mac OS 10.11.15, and tried to import a bookmarks file exported from Chrome. Buku threw the following error:
usage: buku [-a URL [tags ...]] [-u [N [URL tags ...]]]
[-t [...]] [-d [N]] [-h]
[-s keyword [...]] [-S keyword [...]]
[-k [N]] [-l [N]] [-p [N]] [-f N]
[-r oldtag [newtag ...]] [-j] [-o N] [-z]
buku: error: unrecognized arguments: --import bookmarks_5_26_16.html
I also tried using -i
instead of --import
, with the same result, and checked the man page and found no mention of 'import'. Is this feature still supported?
Greetings,
buku --sany http://www.something.com/
fails while
buku --sany http://www.something.com
does not, even if the former is the url as displayed by buku.
Hi,
I was wondering if you would consider using subcommands rather than command line flags for the various operations that buku provides.
For now, I found the usage section too complicated to read : I need to read the description to know how to perform an action.
Instead, you could have
buku rm|remove|delete
buku tags
buku open
buku ls
buku show
What do you think ?
Can we have an option "add link to buku" when right clicked on a link in firefox? The option can fire up terminal with the url took from firefox and we just have to add tags there.
With version 2.0 I can't seem to import any bookmarks.
carnager@caprica ~/Documents > buku -i bookmarks_5_26_16.html
usage: buku [-a URL [tags ...]] [-u [N [URL tags ...]]]
[-t [...]] [-d [N]] [-h]
[-s keyword [...]] [-S keyword [...]]
[-k [N]] [-l [N]] [-p [N]] [-f N]
[-r oldtag [newtag ...]] [-j] [-o N] [-z]
buku: error: unrecognized arguments: -i bookmarks_5_26_16.html
The following command fails with Buku:
buku -w 'macvim -f'
As a result macvim opens in the background and exits.
short:
Could you implement an option to simply allow the user to update the title manually?
long explenation:
A few years ago, I remapped the bookmarking hotkey in my .vimperatorrc
for some sites, to a javascript snippet that serves as a shim. It fetches and then simplifies the title of the current page, and automatically applies tags, before it bookmarks that page using firefox's internal service. Since vimperator makes it is possible to execute some shell commands, I might try to change that to bookmark using Buku.
thanks for this tool!
buku.py is an UTF-8 file but setup.py opened it in ASCII mode instead of UTF-8 mode.
I: pybuild base:184: python3.5 setup.py clean
Traceback (most recent call last):
File "setup.py", line 13, in
version = re.search('version = '([^\']+)'', f.read()).group(1)
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 65988: ordinal not in range(128)
E: pybuild pybuild:276: clean: plugin distutils failed with: exit code=1: python3.5 setup.py clean
I already sent the pull request. #101
Idea of saving data to mysql database? LIVE database not on local pc
Accidentally, by omitting the bookmark number, I updated the titles to all my records :) Not fun..
I believe the update command should ask for confirmation if no index is provided.
It would be very frustrating if you have 10K records..
Thanks,
Continued from #14.
The list below is a growing one. While suggesting new features please consider contributing to Buku
. The code is intentionally kept simple and easy to understand with comments. We'll be happy to help out any new contributor.
Some of the just-completed features may not have been released yet. Grab the master branch for those.
googler
source)buku shows id, url and tags in -p output.
Problem is that tags can have spaces, which makes proper parsing a mess.
A very easy solution would be to use tabs instead of spaces:
ID\tURL\tTAGS
The following command deletes search results though it should delete the bookmark at DB index 5:
$ buku -s hello -d 5
Search results should be deleted only if -d
is passed without a value, like:
$ buku -s hello -d
Otherwise, it should process delete option separately.
$ buku -a "https://groups.google.com/forum/#!forums/iamthecavalry" personal, security
-bash: !forums/iamthecavalry": event not found
I tried wrapping the URL in "" and not, both ways get the same error. I don't find anything about this in the help or readme.md.
Any ideas? Thanks.
please implement password protection
The requirement came from @cpaulik in #39 (comment):
It would be great if there would be an option during import to use the existing folder names from Chrome as tags in buku.
With the support for URL shortening, why not introduce an option to store URLs directly shortened with --add
option. Another improvement would be to (un)shorten URLs stored in DB with --update
.
Hello there,
I have some weird issue on VoidLinux distro:
~ [ buku -p | tail -3 ] 9:59 PM
File "/usr/bin/buku", line 1535
print('\nInterrupted.', file=sys.stderr)
^
SyntaxError: invalid syntax
I would like to know, if there is problem with database, or the package is somehow wrong in VoidLinux:
pkgver: buku-2.5_1
repository: http://repo.voidlinux.eu/current
What a great little utility! Really like how buku works. But to make it useful to me, I'd need to import all of my bookmarks in it somehow. Now that Delicious is dead (it's basically unusable), Iโve been looking for alternatives so I'm glad I came across this.
Since I have 40,000+ links in my bookmarks.html, adding them is a problem. I wish there was an automated way. Also, buku doesn't seem to have a "comment" field. Most bookmark managers have that.
Great util! Thank you for releasing it.
Hi @jarun
This is just a question why don't you put this project inside a proper python file structure please see link below.
https://github.com/kennethreitz/samplemod
Simple and easy to read and not have 1 file consisting 2921 lines of code.
Note: This is my first interaction with an Open Source Community. My apologies if I happen to make any mistakes. I was directed to this project from http://up-for-grabs.net/#/
Getting to the point:
Operating System: OS X El Capitan Version 10.11
Python Version: 3.4.2
I followed the installation steps and got buku v1.9 running on a virtual environment.
sagarbhuta$ buku -a -m 'Up for Grabs' http://up-for-grabs.net/#/ oss, projects
Output:
Added at index 1
1. http://up-for-grabs.net/#/
Up for Grabs
[TAGS] oss,projects
sagarbhuta$ buku -d 1
Output:
Removed index 1
Traceback (most recent call last):
File "/usr/local/bin/buku", line 1224, in <module>
cleardb(conn, cur, entry)
File "/usr/local/bin/buku", line 599, in cleardb
compactDB(conn, cur, int(index))
File "/usr/local/bin/buku", line 566, in compactDB
if row[0] > index:
TypeError: unorderable types: NoneType() > int()
sagarbhuta$ buku -a -m 'Bookmark Manager' https://github.com/jarun/Buku command line, bookmarks, manager
Added at index 1
1. https://github.com/jarun/Buku
Bookmark Manager
[TAGS] command line,bookmarks,manager
sagarbhuta$ buku -a -m 'Up for Grabs' http://up-for-grabs.net/#/ oss, projects
Added at index 2
2. http://up-for-grabs.net/#/
Up for Grabs
[TAGS] oss,projects
sagarbhuta$ buku -d 1
Removed index 1
Index 2 moved to 1
sagarbhuta$ buku -g
1. oss
2. projects
sagarbhuta$ buku -d 1
Removed index 1
Traceback (most recent call last):
File "/usr/local/bin/buku", line 1224, in <module>
cleardb(conn, cur, entry)
File "/usr/local/bin/buku", line 599, in cleardb
compactDB(conn, cur, int(index))
File "/usr/local/bin/buku", line 566, in compactDB
if row[0] > index:
TypeError: unorderable types: NoneType() > int()
I really like the concept, but keeping it only as a CLI-utility makes it hard to do interesting things.
It would be cool if you could abstract out some of the complexity (db connections, file encryption etc) so that you end up with a simple object that can then be called from other scripts. I'm thinking something like
import buku
db = buku.BukuDb()
db.addItem(url, title, description, keywords)
items = db.search(param=value)
This would make it easier to write add-ons / import mechanisms and so on in Python, rather than having to pipe through the CLI (slow) or decipher all your internals (error-prone, inflexible).
Keep up the good work! ๐ ๐
not working due to:
_arguments:comparguments:319: invalid option definition: (-f --format)-f[limit fields in print and Json output:value
fixed with #110
All of the short arg options have a single hyphen if they support a long and short form. Example:
-a, --add URL [tags ...]
But currently the search tags option lists the following options:
--st, --stag [...] search bookmarks by tag list tags alphabetically, if no arguments
It appears to be the only option where the short option enforces two hyphens as opposed to 1 hyphen.
I attempted to use buku -st
to list my tags and saw no output; while I expected the option to work. Perhaps this was a simple typo in the sourcecode? I can supply a PR later today.
It would be nice to have regexp search in titles/keywords
Also, an idea would be to have an option to fetch the page content (eg. wget/w3m/curl) and search inside the body
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.