diff --git a/drush/simplehtmldom.drush.inc b/drush/simplehtmldom.drush.inc
new file mode 100644
index 0000000..7503682
--- /dev/null
+++ b/drush/simplehtmldom.drush.inc
@@ -0,0 +1,119 @@
+<?php
+
+/**
+ * @file
+ *   drush integration for simplehtmldom.
+ */
+
+/**
+ * The simplehtmldom plugin URI.
+ */
+define('SIMPLEHTMLDOM_DOWNLOAD_URI', 'https://github.com/konstantin-komelin/simplehtmldom/archive/master.zip');
+define('SIMPLEHTMLDOM_DOWNLOAD_PREFIX', 'simplehtmldom-');
+
+/**
+ * Implementation of hook_drush_command().
+ *
+ * In this hook, you specify which commands your
+ * drush module makes available, what it does and
+ * description.
+ *
+ * Notice how this structure closely resembles how
+ * you define menu hooks.
+ *
+ * See `drush topic docs-commands` for a list of recognized keys.
+ *
+ * @return
+ *   An associative array describing your command(s).
+ */
+function simplehtmldom_drush_command() {
+  $items = array();
+
+  // the key in the $items array is the name of the command.
+  $items['simplehtmldom-plugin'] = array(
+    'callback' => 'drush_simplehtmldom_plugin',
+    'description' => dt('Download and install the simplehtmldom plugin.'),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap.
+    'arguments' => array(
+      'path' => dt('Optional. A path where to install the simplehtmldom plugin. If omitted Drush will use the default location.'),
+    ),
+    'aliases' => array('simplehtmldomplugin'),
+  );
+
+  return $items;
+}
+
+/**
+ * Implementation of hook_drush_help().
+ *
+ * This function is called whenever a drush user calls
+ * 'drush help <name-of-your-command>'
+ *
+ * @param
+ *   A string with the help section (prepend with 'drush:')
+ *
+ * @return
+ *   A string with the help text for your command.
+ */
+function simplehtmldom_drush_help($section) {
+  switch ($section) {
+    case 'drush:simplehtmldom-plugin':
+      return dt('Download and install the simplehtmldom plugin from https://github.com/konstantin-komelin/simplehtmldom/archive/master.zip, default location is sites/all/libraries.');
+  }
+}
+
+
+/**
+ * Command to download the simplehtmldom plugin.
+ */
+function drush_simplehtmldom_plugin() {
+  $args = func_get_args();
+  if (!empty($args[0])) {
+    $path = $args[0];
+  }
+  else {
+    $path = 'sites/all/libraries';
+  }
+
+  // Create the path if it does not exist.
+  if (!is_dir($path)) {
+    drush_op('mkdir', $path);
+    drush_log(dt('Directory @path was created', array('@path' => $path)), 'notice');
+  }
+
+  // Set the directory to the download location.
+  $olddir = getcwd();
+  chdir($path);
+
+  // Download the zip archive
+  if ($filepath = drush_download_file(SIMPLEHTMLDOM_DOWNLOAD_URI)) {
+    $filename = basename($filepath);
+    $dirname = SIMPLEHTMLDOM_DOWNLOAD_PREFIX . basename($filepath, '.zip');
+
+    // Remove any existing simplehtmldom plugin directory
+    if (is_dir($dirname) || is_dir('simplehtmldom')) {
+      drush_delete_dir($dirname, TRUE);
+      drush_delete_dir('simplehtmldom', TRUE);
+      drush_log(dt('A existing simplehtmldom plugin was deleted from @path', array('@path' => $path)), 'notice');
+    }
+
+    // Decompress the zip archive
+    drush_tarball_extract($filename);
+
+    // Change the directory name to "simplehtmldom" if needed.
+    if ($dirname != 'simplehtmldom') {
+      drush_move_dir($dirname, 'simplehtmldom', TRUE);
+      $dirname = 'simplehtmldom';
+    }
+  }
+
+  if (is_dir($dirname)) {
+    drush_log(dt('simplehtmldom plugin has been installed in @path', array('@path' => $path)), 'success');
+  }
+  else {
+    drush_log(dt('Drush was unable to install the simplehtmldom plugin to @path', array('@path' => $path)), 'error');
+  }
+
+  // Set working directory back to the previous working directory.
+  chdir($olddir);
+}
diff --git a/simplehtmldom.install b/simplehtmldom.install
index 98f91fc..8c6ae69 100644
--- a/simplehtmldom.install
+++ b/simplehtmldom.install
@@ -19,15 +19,36 @@ function simplehtmldom_requirements($phase) {
   // Include the helper file.
   module_load_include('inc', 'simplehtmldom', 'helper');
 
-  if (_simplhtmldom_get_library_path()) {
-    $requirements['simple_html_dom']['value'] = $t('Installed');
-    $requirements['simple_html_dom']['severity'] = REQUIREMENT_OK;
-  }
-  else {
-    $requirements['simple_html_dom']['value'] = $t('not installed');
-    $requirements['simple_html_dom']['severity'] = REQUIREMENT_ERROR;
-    $requirements['simple_html_dom']['description'] = $t('simple_html_dom.php is missing. Please copy the latest version of simple_html_dom.php (PHP Simple HTML DOM Parser library) from http://sourceforge.net/projects/simplehtmldom/ to you libraries folder, for example sites/all/libraries/simplehtmldom/simple_html_dom.php');
-  }
+  if ($phase == 'runtime') {
+    $t = get_t();
+    $library = libraries_detect('simplehtmldom');
+    $error_type = isset($library['error']) ? drupal_ucfirst($library['error']) : '';
+    $error_message = isset($library['error message']) ? $library['error message'] : '';
+
+    if (empty($library['installed'])) {
+      $requirements['simplehtmldom_plugin'] = array(
+        'title' => $t('simplehtmldom plugin'),
+        'value' => $t('@e: At least @a', array('@e' => $error_type, '@a' => SIMPLEHTMLDOM_MIN_PLUGIN_VERSION)),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('!error You need to download the !simplehtmldom, extract the archive and place the simplehtmldom directory in the %path directory on your server.', array('!error' => $error_message, '!simplehtmldom' => l($t('simplehtmldom plugin'), $library['download url']), '%path' => 'sites/all/libraries')),
+      );
+    }
+    elseif (version_compare($library['version'], SIMPLEHTMLDOM_MIN_PLUGIN_VERSION, '>=')) {
+      $requirements['simplehtmldom_plugin'] = array(
+        'title' => $t('simplehtmldom plugin'),
+        'severity' => REQUIREMENT_OK,
+        'value' => $library['version'],
+      );
+    }
+    else {
+      $requirements['simplehtmldom_plugin'] = array(
+        'title' => $t('simplehtmldom plugin'),
+        'value' => $t('At least @a', array('@a' => SIMPLEHTMLDOM_MIN_PLUGIN_VERSION)),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('You need to download a later version of the !simplehtmldom and replace the old version located in the %path directory on your server.', array('!simplehtmldom' => l($t('simplehtmldom plugin'), $library['download url']), '%path' => $library['library path'])),
+      );
+    }
 
   return $requirements;
 }
+}
\ No newline at end of file
