Author Topic: a little trick with Chrome bookmarks  (Read 11455 times)

0 Members and 1 Guest are viewing this topic.

Offline JeanFTopic starter

  • Regular Contributor
  • *
  • Posts: 142
  • Country: fr
a little trick with Chrome bookmarks
« on: January 05, 2013, 10:01:43 pm »
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 html HERE (I discovered it on this other page where 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.py
curl -v -T D:\bookmarks\bookmarks.html ftp://yourlogin:yourpassword@yourftpserver/www/thepathyouwant/thenameyouwant.html
pause


and 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 explained here.

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 mode

to use the task scheduler, see This.

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 year ;)

JF
 

Offline justanothercanuck

  • Frequent Contributor
  • **
  • Posts: 391
  • Country: ca
  • Doing retro repairs...
Re: a little trick with Chrome bookmarks
« Reply #1 on: January 05, 2013, 10:05:21 pm »
Does chrome work with Xmarks?  Works wonders for me.
Maintain your old electronics!  If you don't preserve it, it could be lost forever!
 

Offline JeanFTopic starter

  • Regular Contributor
  • *
  • Posts: 142
  • Country: fr
Re: a little trick with Chrome bookmarks
« Reply #2 on: January 05, 2013, 10:13:23 pm »
yes, apparently... I haven't tried. It looks good ; I just wanted to have a homemade solution :)
 

Offline Sionyn

  • Frequent Contributor
  • **
  • Posts: 848
  • Country: gb
Re: a little trick with Chrome bookmarks
« Reply #3 on: January 05, 2013, 11:28:47 pm »
cURL is a file transfer tool but dose more Daniel is a awesome guy that dose hardware hacking for rockbox 
eecs guy
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf