2017 © Pedro Peláez
 

library simplescraper

A (very) simple URL scraper that fetches title, description and images.

image

negative/simplescraper

A (very) simple URL scraper that fetches title, description and images.

  • Friday, May 2, 2014
  • by pierlo-upitup
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simplescraper

Build Status, (*1)

A (very) simple URL scraper that fetches title, description and images., (*2)

Installation

Install via Composer, (*3)

    composer require negative\simplescraper 

version: dev-master., (*4)

Add, (*5)

    'Negative\Simplescraper\SimplescraperServiceProvider'

to your app/config.php $providers array, (*6)

Please check vendor/negative/simplescraper/src/config/config.php for configuration options., (*7)

Publish the configuration file by running, (*8)

php artisan config:publish negative/simplescraper

and edit the configuration file under, (*9)

/app/config/packages/negative/simplescraper/config.php

That's about it., (*10)

Usage

Simply call:, (*11)

    Simplescraper::lookup('http://www.ikea.com/us/en/catalog/products/60202199/');

It will return an array like this:, (*12)

    array(
        "url" => "http://www.ikea.com/us/en/catalog/products/60202199/",
        "title" => "FALSTER Table - gray  - IKEA",
        "description" => "IKEA - FALSTER, Table, gray , Polystyrene slats are weather-resistant and easy to care for.The furniture is both sturdy and lightweight as the frame is made of rustproof aluminum.You can easily sand down light scratches on the slates with fine sandpaper.",
        "images" => ["uploads/simplescraper/5329acc4378bb.jpg"]
    )

The config allows for the following options:, (*13)

// If defined, download the scraped images to this directory
// PLEASE NOTE: use a dedicated folder if you want to use download_ttl
'download_dir' => public_path().'/uploads/simplescraper/',

// Delete downloded images after (seconds)
// set to zero to prevent automatic cleanup
'download_ttl' => 120, 

// The maximum number of images to download
'max_imgs' => 1,

// Set a minimum size for the images that are shown.  This requires
// a download_dir to be set.
'minimum_size' => '300x200'

Credits

Inspired by the Laraval 3 bundle Scrapey https://github.com/BKWLD/scrapey ., (*14)

The Versions

02/05 2014

dev-master

9999999-dev

A (very) simple URL scraper that fetches title, description and images.

  Sources   Download

The Requires

 

by Negative