#impurge
This is a simple module meant to extract image URLS from imgur images in a standard format despite differences in URL format
Example:
var impurge = require('impurge');
impurge.purge("http://imgur.com/IvpcP", function (e,r) {
console.log(r)
});
will result in:
http:
or for multiple images
var impurge = require('impurge');
impurge.purge("http://imgur.com/a/QgHRA", function (e,r) {
console.log(r)
});
will result in:
[ 'http://i.imgur.com/OzAiFJ5.jpg',
'http://i.imgur.com/AS76Rhx.jpg',
'http://i.imgur.com/gx436Y2.jpg' ]
It currently supports:
The new test file included will check the currency of the regular expressions against live reddit data to ensure imgur is not changing link formats and will look for any it does not recognize
I have added a few additional methods that I used for testing the accuracy of my regex's
impurge.is_imgur(url);
the following takes a string input and will return an array of imgur links contained within
impurge.get_text_imgur_links(text);
and finally I exposed a function to determine the link type (previously used internally)
impurge.determine_link_type(url, function(err, type, id, i_url){
});