Archive

Posts Tagged ‘python’

Public directories in Dropbox

February 27, 2011 1 comment

A few weeks ago a friend asked me how to share directories in Dropbox. I couldn’t really figure it out myself, so I told him to zip the files. It wasn’t the most elegant solution, but it worked sorta. It wasn’t until just recently that I had a better solution. It still isn’t the best, but it’s definitely a step in the right direction.

Basically what I did was created a python script that generates an HTML file with links to the files in the public directory (the current working directory).

I haven’t worked with HTML in a really long time, so this was a fun little thing.

Now my first attempt at this wasn’t very glamorous, but I needed a rough idea on how this was going to work.

Ok cool, I had a working prototype. It wasn’t pretty, but that’s fine for now. I put a little more work into it by changing the html, getting rid of the bullet points, and I even added some graphics for non-image files.

Now I know what you’re thinking, “Bro you have some killer art skills” Thanks! I’ve settled on this for now, as it works  pretty well for most people’s needs.

In the future I will probably make it look less amateur. Feel free to add your own icons, and filetypes. Feedback and comments welcome.

Just run the python script and it will make an html file called ‘pub_dir.html’. That will be your folder to share with people.

Bugs I can think off the top of my head:

  • the folder links won’t work due to naming errors

Here is the download link:

http://www.mediafire.com/?c67634qx6z3kcwy

Advertisements
Categories: Programming Tags: ,