a little trick with Chrome bookmarks - Page 1
Forum section: electronics / general

author: JeanF
author_rank: Regular Contributor
timestamp: January 05, 2013, 10:01:43 pm
content: hello everyone. This is not really electronics, but...I just discovered a little trick that I found quite good and I wanted to share it. It may be useful to another one of us, who knows ?The goal is to save my Chrome bookmarks, which I use extensively (damn, all those datasheets and nice stuff everywhere...), on an online support to be able to access them when I'm not on my own computer. Of course, many websites offer this service (Diigo, Delicious...) and even Google offers that. But if you use Chrome and you already have some sort of web hosting service (free or not ; for your website, your blog or just your average stuff...), you may find useful or fun to do it yourself.Chrome has a built-in "export bookmarks to html" function, so it would be neat to upload this html file to your personal web hosting, and keep it up to date...You can find a cool Python script to export the Chrome bookmarks database in htmlHERE(I discovered it on this otherpagewhere the same script is also in Java)so if you don't mind using Python, here you are. If you don't have it, install Python for your system, then you have to edit the script (with IDLE, which comes with Python for Windows, or with any other editor) to set the proper path of your Chrome bookmarks file. It's in your Chrome install folder, under User data\default, and its just a file named "Bookmarks".If you are using windows, beware that paths don't use the same backslashes than Linux or Mac. So to prevent Python from being fooled, you have to double them. In my case : input_filename = "C:\\Users\\me\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Bookmarks" (I deleted the % user that was at the end, I don't know what it does, at least with Win7...)also set the output html file, with the same remark concerning backslashes.then you test it in a command window by using the command "python the_path_of_the_script\the_script.py" and verify that you get your html bookmark file.The next step is to upload the file.I used cURL, a very nice free FTP client in command-line, under MIT license.you've to download the proper version from the website :http://curl.haxx.se/then I added curl.exe to the path to make things easier, but you decide,I've made a very simple batch file which contains :python D:\scripts\export-bookmarks.pycurl -v -T D:\bookmarks\bookmarks.htmlftp://yourlogin:yourpassword@yourftpserver/www/thepathyouwant/thenameyouwant.htmlpauseand there you have it. When the .bat file is launched, your bookmarks are exported (no need to close Chrome btw, which is nice) and uploaded.Once you've checked if it works, you can remove the line "pause" in the bat file, and you may want to secure the page using a .htaccess in the dedicated folder and a .htpasswd anywhere else, it's very easy, plenty of tutorials available.the last step is to make all this automatic, and invisible...The .bat file pops out when it's running, that's not very pretty. You can make a shortcut of it and choose "launch in minimized" in the properties, or you can even make a very simple VBS script which will run the commands totally silently, as explainedhere.Then, you just have to use the Task Scheduler to run it periodically. The task will point to :- the .bat itself if you don't mind seeing it pop- the .lnk shortcut if you want to see it only in the taskbar- the .vbs if you want stealth modeto use the task scheduler, seeThis.When creating the task, you can't make it run more than once a day, but do it anyway, there's a trick afterwards. When the task is done, open its Properties, and in the second tab, click modify and you can select "repeat task every... for..." down to 5 or 10 minutes if you want.Be careful if you're using a laptop, there's also an option which cancels the task when on battery, I had to disable it.There you have it ! a nice web page in your online folder, protected by password, which contains your bookmarks and is frequently (and silently) updated, and you can even have them on your phone, without having to rely on a private company !I hope it may help someone, if you use Chrome and have a small webpage, don't be fooled by my poor explanations, it's very easy.Sorry for my mistakes in English... I do my best.happy new yearJF

author: justanothercanuck
author_rank: Frequent Contributor
timestamp: January 05, 2013, 10:05:21 pm
content: Does chrome work with Xmarks? Works wonders for me.

author: JeanF
author_rank: Regular Contributor
timestamp: January 05, 2013, 10:13:23 pm
content: yes, apparently... I haven't tried. It looks good ; I just wanted to have a homemade solution

author: Sionyn
author_rank: Frequent Contributor
timestamp: January 05, 2013, 11:28:47 pm
content: cURL is a file transfer tool but dose more Daniel is a awesome guy that dose hardware hacking for rockbox