WevDAV-js update

I’ve recently updated my JS bookmarklet webdav-js and added in some new features including tracking the history state, back button support and proper navigation.

The main thinking behind the bookmarklet is to enable easy manipulation of WebDAV shares without leaving the browser. This bookmarklet allows you to, at the click of the button, browse and upload to WebDAV shares, all within the browser. I’m working on copy/move functionality but currently it supports the basics.

It’s available on github and you can drag the bookmarklet here directly to your bookmarks bar:

Continue reading “WevDAV-js update”

WebDAV file upload bookmarklet

I recently had a discussion with a co-worker as to whether or not it would be possible to upload files to a WebDAV server via AJAX and in doing so discovered it is indeed totally possibly to do so and so I went on a little bit of a mission and made a pretty basic interface for apache that replaced the standard directory listing and have also made a bookmarklet.

There’s no demo I’m afraid, however the bookmarklet should work on just about any WebDAV server (at least, it worked on mine…), but you won’t have pretty code highlighting :(.

I’ve set up a github repository but you can use the bookmarklet directly.

Note: This will almost certainly not work in IE and I’ve only tested Firefox and Chrome (latest versions).

EDIT: minor update and moved to GitHub pages instead of using raw which caused problems with the CSS on Firefox.

php-log: Process apache log files with PHP

I’ve recently had to quickly parse an Apache log file, to get basic usage statistics for a site over a month and wanted the ability to quickly process any general logs and store them in a MySQL table, so I’ve made a small package class.log.

Included in the package are:

  • class.log.php (the main class)
  • class.log.processor.php (an interface for a log processor, very basic!!)
  • class.log.output.php (a simple extension of the processor (outputs <p> tags with <span>s)
  • class.log.mysql.php (a simple mysql importer of the processed data)
  • parse.php (a simple implementation, bringing all the classes together)

The class is designed to use one line at a time from the log retrieved, and the regular expression specified in class.log.php can be modified to parse different types of logs as long as the matches array is also updated.

I’ve only used this for apache logs currently, which it managed quite well, I’m not sure if I’d use this script in an automated script, but I’ll leave that for you to decide.

As other scripts, this class is available under the Creative Commons Share Alike Attribution license.

Edit: Minor update, made class more generic and added more comments.

Download (3.7kB)