GithubHelp home page GithubHelp logo

isabella232 / wds-image-grabber Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webdevstudios/wds-image-grabber

0.0 0.0 0.0 128 KB

Get a list of image URLs from a remote address and return them in an array

PHP 100.00%

wds-image-grabber's Introduction

WDS Image Grabber

Version: 0.1.0
Contributors: George Mamadashvili, Jay Wood
Description: Class to grab images from the body of a website.
Author: WebDevStudios
Author URI: http://webdevstudios.com/
Requires at least: 3.6.0
Tested up to: 4.2.2
Stable tag: 0.1.0
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

A PHP class to get a list of image URLs from a remote address and return them in an array. Works in conjunction with CMB2 Remote Image Select Field to provide users a facebook-style image selector for post-meta data.

The script looks for og:image tags first, then looks for all <img> tags within the content of the entire site. Additionally it now provides a few extra checks to ensure that the image should in-fact be pulled into the list, the rules are as follows:

  1. If the image has no height/width element, it will not be pulled
  2. If height or width are less than 70px, it will not be pulled
  3. If image is relative such as src="/relative/path.jpg" it will not be pulled

This can be changed, or expanded upon by editing the WDS_Image_Grabber::img_tags() method.

Usage Example

$url = 'http://www.amazon.com//Sales-Grocery/b?ie=UTF8&node=52129011&ref_=amb_link_353229922_2';   
$grabber = new WDS_Image_Grabber( $url );   
$images = $grabber->get_images();   
var_dump( $images );   

Installation

Manual Installation

  1. Upload the entire /wds-image-grabber directory to the /wp-content/plugins/ directory.
  2. Activate CMB2 Remote Image Select through the 'Plugins' menu in WordPress.

Frequently Asked Questions

  • None as of yet

Changelog

0.1.0

  • First release

wds-image-grabber's People

Contributors

jaywood avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.