[Tutorial] emanon's Image Dowloander Java Script

Tutorials and how-to's.
Post Reply

0
No votes
 
Total votes: 0

emanon
Posts: 2122
Joined: Wed Feb 16, 2005 3:46 pm

[Tutorial] emanon's Image Dowloander Java Script

#1

Post by emanon »

This is a little different than an extension, but is very handy nonetheless...
Imagine yourself browsing a site that has a lots of images in the same directory and you notice the images have part of the url that is sequentially numbered. You say to yourself, "Geez, instead of loading these images one at a time, I wish I could get them all on one page." Now you can with this little javascript "bookmarklet". To use this all you have to do is:
1) right click on an empty spot onyour Personal Bookmarks Toolbar
2) Select New Bookmark
3) Give it a clever name like "num links new page"
4) copy and paste the code from the end of this post into the location field.
5) close and if necessary drag the newly created link to an area that is accessable.
6) Next time you are at a site with sequentially numbered pages, click on the bookmarklette and a new window opens with the URL at the top and text boxes to specify ranges for the numbered portions. Enter the appropriate values and the list automagically appears.
7) The original page must remain open for the javascript to work.
8) Once you have the links listed, you may use either DownThemAll mentioned above, or the Linky extension to "Show all Image Links in One tab" which will as you guessed, open all the images on one tab for your viewing convenience.

java script:->
CODEjavascript:(function(){ function selectColor(i) { return [%22#fdc%22, %22#cdf%22, %22#bfd%22, %22#dbf%22, %22#fbd%22] [i%5]; } var u=location.href, ul=u.length; var tparts=[%22%22], zparts=[], nz=0; function isDigit(c) { return (%220%22 <= c && c <= %229%22); } for (i=0; i<ul; ) { for (; i<ul && !isDigit(u.charAt(i)); ++i) tparts[nz] += u.charAt(i); if(i<ul) { zparts[nz]=%22%22; for (; i<ul && isDigit(u.charAt(i)); ++i) zparts[nz] += u.charAt(i); tparts[nz+1]=%22%22; ++nz; } } if(!nz) { alert(%22No numbers in URL.%22); return; } D=window.open().document; D.write(); D.close(); function a(n) { A(D.body,n); } function A(p,n) { p.appendChild(n); } function E(q) { return D.createElement(q); } function cT(t) { return D.createTextNode(t) } function cBR() { return E(%22br%22); } function cS(t,ci) { var s=E(%22span%22); s.style.background=selectColor(ci); s.style.fontWeight=%22bold%22; A(s, cT(t)); return s; } function cTB(v,oc) { var b=E(%22input%22); b.size=6; b.value=v; b.addEventListener(%22input%22, oc, false); return b; } function cCB(t,oc) { var L=E(%22label%22), b=E(%22input%22); b.type=%22checkbox%22; b.checked=true; b.onchange=oc; A(L,b); A(L,cT(t)); return L; } function cL(nz,tparts,zparts) { var L=E(%22a%22); var u=%22%22; for (var i=0; i<nz; ++i) { A(L,cT(tparts)); A(L,cS(zparts, i)); u += tparts+zparts; } A(L,cT(tparts[nz])); u += tparts[nz]; L.href=u; L.target=%22_blank%22; return L; } a(cT(%22Original URL: %22)); a(cBR()); a(cL(nz, tparts, zparts)); a(cBR()); a(cBR()); var fromBoxes=[], toBoxes=[], padChecks=[]; for (i=0; i<nz; ++i) { a(cT(%22Run %22)); a(cS(zparts, i)); a(cT(%22 from %22)); a(fromBoxes=cTB(zparts, listURLs)); a(cT(%22 to %22)); a(toBoxes=cTB(zparts, listURLs)); a(cT(%22 (%22)); a(j=cCB(%22 Pad with zeroes to maintain length%22, listURLs)); padChecks=j.childNodes[0]; a(cT(%22)%22)); a(cBR()); } a(cBR()); resultDiv=E(%22div%22); a(resultDiv); listURLs(); function listURLs() { while (resultDiv.childNodes.length) resultDiv.removeChild(resultDiv.childNodes[0]); var lows=[], highs=[]; for (i=0; i<nz; ++i) { lows[i]=parseInt(fromBoxes[i].value, 10); highs[i]=parseInt(toBoxes[i].value, 10); if(highs[i]-lows[i] > 999) { A(resultDiv, cT(%22Too many%22)); return; } } urls=[]; function cb(sta) { var newzparts=[]; for (var i=0; i<nz; ++i) { var z=%22%22+sta[i]; if(padChecks[i].checked) while (z.length < zparts[i].length) z=%220%22+z; newzparts[i]=z; } A(resultDiv, cL(nz, tparts, newzparts)); A(resultDiv, cBR()); } fors(nz, cb, lows, highs); } function fors (n, callback, lows, highs) { function fors_inner (states, v) { if(v >= n) callback(states); else for (states[v]=lows[v]; states[v] <= highs[v]; ++(states[v])) fors_inner(states, v+1); } fors_inner ([], 0); } })()

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#2

Post by AYHJA »

Yo Ace...

I had to give this little post here its on thread, cause it seems like something pretty interesting...You may be about to teach me how to fish...I can rip most sites, but I am having trouble ripping a few like this one:

http://www.canadaka.net/modules.php?op= ... all&gid=35

Say I want to download all the Jaime Koeppe pictures on that site...Will that script help..?

BBcode:
Hide post links
Show post links
emanon
Posts: 2122
Joined: Wed Feb 16, 2005 3:46 pm

#3

Post by emanon »

this script does not help much when there have been random letters incorporated into the filename part of the url unless you can figure out a pattern

have you tried google hacking em?

BBcode:
Hide post links
Show post links
User avatar
AYHJA
392
Posts: 37990
Joined: Fri Sep 17, 2004 2:25 pm
Location: Washington, D.C.
Contact:

#4

Post by AYHJA »

I"m sorry...

A "Google" hack..? :?

BBcode:
Hide post links
Show post links
emanon
Posts: 2122
Joined: Wed Feb 16, 2005 3:46 pm

#5

Post by emanon »

Copied from another forum:

INTRO TO HACKING/CRACKIGN WITH GOOGLE
-Many of you probably already know this, but you can hack/crack with google. I use it in 100% of the
hacks/cracks I perform. You can use google to help you hack/crack in a few different ways. I will discuss
these in the sections below ("no shit!")

A. intitle:
-This is a built in function in google that searches for your phrase in the title of a web page. The
title of a webpage is in the upper left of your current window. (you should see google.txt if someone
hasnt changed the name). This is useful if you want to find something VERY specific.
-examples: intitle:"billing" intitle:"payments" intitle:"passwd"

B. Directory Indexing
-One GREAT trick is to find sites that allow directory indexing. This can be done by searching
intitle:"index of" phrase. Your mind should now be about to explode with the possibilities this could
hold. If it doesn't, that's ok, because if you look at the end of this article you'll see i've
provided you with an uber cool list! Here are some basic phrases you can use: intitle:"index of"
"passwd" OR "passwd.txt" OR "AutismIsSoCool!". This searches for files named passwd or if that isnt
found, searches for passwd.txt or if that isnt found searches for AutismIsCool! Think original, and
you can come up with the coolest stuff! I'm not just talking about passwords... I'm talking about
warez, passwords, and even credit card numbers!!! (although to be honest it's not easy )

C. allinurl:
-Guess what this does! Usufull for things like jpg mpg avi or if you know the directory name but not the file names. also useful for php, and asp links.

D. Cache
-Perhaps you have been searching for intitle:"index of" etc/shadow, and you see what looks like a valid
shadow file in your results list, but you cant access it, because you arent root, or whatever. Well thanks to
google cache, it may be possible for you to view this file. Just click the little chached link under the
result!
+note: this doesnt work 100% of the time
<<<
end of paste
a coolio link to check out is:
CODE

http://johnny.ihackstuff.com

BBcode:
Hide post links
Show post links
Post Reply