Class SpazImageURL

Defined in: spazimageurl.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
SpazImageURL(args)

a library to get direct image urls for various image hosting servces

Method Summary
Method Attributes Method Name and Description
 
addAPI(service_name, opts)

add a new API for a service

 

find the image service URLs that work with our defined APIs in a given string

 
getAPI(service_name)

get an api for a service

 

retrieve APIs

 

given a single image hosting service URL, this returns a URL to the image itself

 

find the image service URLs that work with our defined APIs in a given string

 

given a string, this returns a set of key:val pairs of main url:image url for image hosting services for urls within the string

 

given a single image hosting service URL, this returns a URL to the thumbnail image itself

 

find the image service URLs that work with our defined APIs in a given string

 

given a string, this returns a set of key:val pairs of main url:thumbnail url for image hosting services for urls within the string

 

Creates the initial default set of API descriptions

Class Detail

SpazImageURL(args)

a library to get direct image urls for various image hosting servces

Parameters:
args
Method Detail

addAPI(service_name, opts)

add a new API for a service

Parameters:
{string} service_name
{object} opts
(url_regex regexp, getThumbnailUrl method, getImageUrl method)

{object|null} findServiceUrlsInString(str)

find the image service URLs that work with our defined APIs in a given string

Parameters:
{string} str
Returns:
{object|null} an object of services (keys) and an array of their matches (vals)

{object} getAPI(service_name)

get an api for a service

Parameters:
{string} service_name
Returns:
{object}

{array} getAPIs()

retrieve APIs

Returns:
{array}

{string|null} getImageForUrl(url)

given a single image hosting service URL, this returns a URL to the image itself

Parameters:
{string} url
Returns:
{string|null}

{object|null} getImagesForMatches(matches)

find the image service URLs that work with our defined APIs in a given string

Parameters:
{object} matches
Returns:
{object|null} fullurl:thumburl key:val pairs

{object|null} getImagesForUrls(str)

given a string, this returns a set of key:val pairs of main url:image url for image hosting services for urls within the string

Parameters:
{string} str
Returns:
{object|null} fullurl:imageurl key:val pairs

{string|null} getThumbForUrl(url)

given a single image hosting service URL, this returns a URL to the thumbnail image itself

Parameters:
{string} url
Returns:
{string|null}

{object|null} getThumbsForMatches(matches)

find the image service URLs that work with our defined APIs in a given string

Parameters:
{object} matches
Returns:
{object|null} fullurl:thumburl key:val pairs

{object|null} getThumbsForUrls(str)

given a string, this returns a set of key:val pairs of main url:thumbnail url for image hosting services for urls within the string

Parameters:
{string} str
Returns:
{object|null} fullurl:thumburl key:val pairs

initAPIs()

Creates the initial default set of API descriptions