We Heart It - Collection Image Grabber

DataMine
by DataMine · 3 posts
9 years ago in Javascript
Posted 9 years ago · Author
About
This is version 1 of my bookmarklet that gives you all of the urls for images in a collection on weheartit.com

This bookmarklet is was designed for a friend and is meant to be used in conjunction with some firefox addons to download all of the images. I plan on keeping this updated and improving it.



How To Install - FireFox

1) Right click on the bookmark toolbar and select "New Bookmark". If you don't have the bookmark toolbar visible press alt to bring up the menubar.
Then click view, hover over Toolbars and click "Bookmark Toolbar"
2) Give the bookmarklet a name by typing something into the "Name" field.
3) Copy and paste the code below into the "Location" field.
4) Click add


How To Install - Chrome

1) Right click on the bookmark toolbar and select "Add Page". If you don't have the bookmark toolbar visible open the settings menu and scroll down to appearance. Then checkmark the box that says "Always show the bookmarks bar".
2) Give the bookmarklet a name by typing something into the "Name" field.
3) Copy and paste the code below into the "URL" field.
4) Click Save

Usage
To use this bookmarklet, navigate to a collection page (example: http://weheartit.com/apipiepie/collecti ... 8741-) and then click on the bookmarklet. A small window should open with a list of all the image urls.


[code=javascript file=Untitled.txt]javascript: (function getCollectionImages() {
var images = [];

$("div[class*='entry entryViewWaypoint-processed']").each(function() {
var imgID = $(this).attr("data-entry-id");
var imgSrc = $(this).children("a").children("img").attr("src");
var extension = imgSrc.substr((imgSrc.lastIndexOf('.') +1));
images.push("http://data1.whicdn.com/images/" + imgID + "/large." + extension + "<br />");
});

var data = images;
myWindow = window.open("data:text/html," + encodeURIComponent(data), "_blank", "width=200,height=100");
myWindow.focus();
})();[/code]
Posted 9 years ago
nice :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT