Best Black Hat Forum

Full Version: Moanon's Auto Image Adder WordPress Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This plugin will automatically adds images to posts by scraping google image search.

Full description:

This Plugin can automatically add Pictures to your posts when publishing. For this it does a Google image search for the Post title and scrapes the first Image. You can choose if the image should be saved in your WordPress or just linked to the original source. Further you can change if the image should be added to the post itself, if so you can choose the alignment, or if it should be set as the Posts featured image or both.

Below is a guide on how to set it up.


How to use it

Installation

In the ZIP-file there is a folder named “auto-image-adder”. Just add this folder to your Plugin directory and then activate it in the WordPress Dashboard. That’s it.

Configuration

All settings can be found under “Settings” -> “Writing”.
  • Save image or just link it – If set to “Save”, the picture will be saved in your own WordPress. If set to “Link”, the picture, when added to the post, will just be an <img>-tag with it’s src-attribute set to the original source.
  • Set image as featured image – If this option is selected the image will be set as the Posts featured image. Also the first option will be ignored because the image has to be saved in WordPress to be set as featured image anyways.
  • Add image to the post – If this is set, the image will be prepended to the Posts content when publishing.
  • Image class(es) – If an image is added to the post here you can define classes that should be added to it
  • Image size – This is used for the scraping. These are the same values as in Google’s image search. Therefor this isn’t do “crop” the images but to initially only search for images this size.
  • Image align – If the image is added to the posts content, this decides if it is aligned left, right or in the middle.
    • Additional feature – Shortcodes

      Another feature built into this plugin is the possible usage of shortcodes. You can use the shortcode [google-search-img] to add scraped images to any post.

      Parameters
      • q=”[search query]”
      • align=”left|center|right”
      • size=”large|medium|pictogram|lt400x300|lt640x480|l t800x600|lt1024x768|lt1600x120​0|lt2272x1704″
      • offset=[offset-number]
      • link="[URL]"
      • class="[class(es)]"
      • id="[id]"
      • a-class="[link class(es)]"
      • a-id="[link id]"
        • with q you can set another query used to search an image.

          offset is the 0 based value of which image from google to take. So 0 is the first, 1 is the second, 2 is the third and so on.

          The link parameter isn't double checked so make sure you use a valid URL

        • Example

          Let’s say you want to add the first 3 results for a search for “ice cream cone” and you want them centered and “large” then you would add the following to your post content:

          [google-search-img q="ice cream cone" align="center" size="large" offset=0]
          [google-search-img q="ice cream cone" align="center" size="large" offset=1]
          [google-search-img q="ice cream cone" align="center" size="large" offset=2]

          Note

          Be aware that with the shortcodes (yet) there is no way to save the scraped images. Might build in this option soon but by now it scrapes the images every time the post is loaded. Therefor too extensive use of this feature may slow down the loading time of the page. Also it is not given that these images are always the same because the order of results in the image search may change.

        • PHP Code:
          [color=#FF8C00]http://multimirrorupload.com/8qt6mlljvg48/auto-image-adder.zip[/color]