WP-Auto Image Grabber

Inserts an image from a page you link to at the start of your blog post. A simple algorithm tries to get a "main content" image, not an ad.

Author:Meitar Moscovitz (profile at wordpress.org)
WordPress version required:2.6
WordPress version tested:3.1.4
Plugin version:0.3.1
Added to WordPress repository:31-10-2010
Last updated:28-02-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://maymay.net/blog/projects/wp-auto-image...
Total downloads:3 563
Active installs:10+
plugin download
Click to start download

Inserts an image from a page you link to at the start of your blog post. A simple algorithm tries to get a “main content” image (rather than an advertisement), automatically providing your post with relevant, attributed artwork. This is especially useful for bloggers who syndicate posts to sites like Facebook or Digg, which use the first image in a post as a thumbnail for their post.

This plugin requires PHP 5; sites running on PHP 4 will produce fatal errors.

By default, the plugin will follow the first link in your blog post and grab what it thinks is an appropriate main content image from there. If your posts follow a particular structure or pattern, you can tell the plugin to follow a certain link (such as a link with a particular class) by setting the Pointer element for destination page value to an XPath query that returns the link you want.

For instance, the following XPath query will match the first link with a class of grab-me:

//a[@class="grab-me"][1]

Here’s an XPath query that will match the first link within the very last paragraph of your post:

//p[position()=last()]/a[1]

For more XPath (and XQuery) syntax examples, refer to the XPath specification at the W3C. If you’re a developer, you may also find several XPath tools helpful.

Additionally, this plugin allows you to set a custom class value on the <img> element that it adds to your post by specifying it in the Image class value setting. For maximum compatibility, consider using one of the WordPress-generated classes most themes utilize. For instance, using alignright will probably make the automatically-added image float to the right.
This plugin uses PHP5’s DOMDocument methods to parse both your post and the remote page. It uses XPath to query the DOM.


Screenshots
FAQ
ChangeLog