{"id":203382,"date":"2010-10-31T08:00:00","date_gmt":"2010-10-31T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/wp-auto-image-grabber\/"},"modified":"2011-02-28T09:08:00","modified_gmt":"2011-02-28T09:08:00","slug":"wp-auto-image-grabber","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/wp-auto-image-grabber\/","title":{"rendered":"WP-Auto Image Grabber"},"content":{"rendered":"<p>Inserts an image from a page you link to at the start of your blog post. A simple algorithm tries to get a \u201cmain content\u201d 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.<\/p>\n<p>This plugin <strong>requires PHP 5<\/strong>; sites running on PHP 4 will produce fatal errors.<\/p>\n<p>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 <code>class<\/code>) by setting the <code>Pointer element for destination page<\/code> value to an XPath query that returns the link you want.<\/p>\n<p>For instance, the following XPath query will match the first link with a class of <code>grab-me<\/code>:<\/p>\n<pre><code>\/\/a[@class=\"grab-me\"][1]\n<\/code><\/pre>\n<p>Here\u2019s an XPath query that will match the first link within the very last paragraph of your post:<\/p>\n<pre><code>\/\/p[position()=last()]\/a[1]\n<\/code><\/pre>\n<p>For more XPath (and XQuery) syntax examples, refer to the <a href=\"http:\/\/www.w3.org\/TR\/xpath\/\" rel=\"nofollow ugc\">XPath specification at the W3C<\/a>. If you\u2019re a developer, you may also find several <a href=\"https:\/\/developer.mozilla.org\/en\/XPath#Tools\" rel=\"nofollow ugc\">XPath tools<\/a> helpful.<\/p>\n<p>Additionally, this plugin allows you to set a custom <code>class<\/code> value on the <code><img><\/code> element that it adds to your post by specifying it in the <code>Image class value<\/code> setting. For maximum compatibility, consider using one of the <a href=\"https:\/\/codex.wordpress.org\/CSS#WordPress_Generated_Classes\" rel=\"nofollow ugc\">WordPress-generated classes<\/a> most themes utilize. For instance, using <code>alignright<\/code> will probably make the automatically-added image float to the right.<br \/>\nThis plugin uses <a href=\"http:\/\/www.php.net\/manual\/en\/book.dom.php\" rel=\"nofollow ugc\">PHP5\u2019s DOMDocument methods<\/a> to parse both your post and the remote page. It uses <a href=\"http:\/\/en.wikipedia.org\/wiki\/XPath\" rel=\"nofollow ugc\">XPath<\/a> to query the DOM.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":65,"featured_media":378702,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WP-Auto Image Grabber - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"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."},"footnotes":""},"categories":[1],"tags":[1471,378],"class_list":["post-203382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-automation","tag-images"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/203382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=203382"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/203382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/378702"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=203382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=203382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=203382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}