Post by xteraco on Dec 7, 2008 6:31:41 GMT -5
I cant sleep, I rolled out of bed at 4am and wandered to my favorite gif page. I don't know why I like looking at animated gifs, but whatever. Anyway, the net is being a little slow so I say to myself "why don't I just rip the gif site and keep it on my hdd".
Good idea! I started looking for a website ripper. I found an open source one called httrack. After about 45 minutes of messing around with it, and trying to rip the site, I decided it was total crap. I got tons of html and other stuff so I decided to give up and play GTA IV (Yes I have a killer PC!!!).
Before starting the game I looked at the directory structure and file naming conventions to see if it looked hackable. Sure enough it seemed very simple. The structure looked like this. "site.com/gif/001.gif". Seeing how simple it was, I quickly busted out my Code::Blocks.
I wrote this bit of code, and used wget (linux tool for downloading urls).
If you are unsure how this code works send me an IM and I will explain it.
I am now ripping all the gif images from the site at supersonic speed!! The example here is, don't just download some crappy tool, code your own. It will work 100% better for the task at hand because you coded it for that exact purpose. This code would work on any site with a simple structure and I am adding it to my library of naughty hacks.
Along with this I have some other custom coded tools I use regularly. An audio player, and a .flv (ripped web vids) player. I'm working on some chat software that my wife and I can use at work to chat, and send files back and forth. Who needs winamp when you can write your own right!?
Good idea! I started looking for a website ripper. I found an open source one called httrack. After about 45 minutes of messing around with it, and trying to rip the site, I decided it was total crap. I got tons of html and other stuff so I decided to give up and play GTA IV (Yes I have a killer PC!!!).
Before starting the game I looked at the directory structure and file naming conventions to see if it looked hackable. Sure enough it seemed very simple. The structure looked like this. "site.com/gif/001.gif". Seeing how simple it was, I quickly busted out my Code::Blocks.
I wrote this bit of code, and used wget (linux tool for downloading urls).
#include<iostream>
#include<string>
#include<sstream>
#include<windows.h>
using namespace std;
int main(){
string getlink;
for(int i = 0 ; i < 999; i++){
stringstream out;
out << i;
getlink = "wget website.com/gifs/" + out.str() + ".gif";
//cout<<getlink.c_str()<<"\n";
system(getlink.c_str());
Sleep(1000);
}
}
If you are unsure how this code works send me an IM and I will explain it.
I am now ripping all the gif images from the site at supersonic speed!! The example here is, don't just download some crappy tool, code your own. It will work 100% better for the task at hand because you coded it for that exact purpose. This code would work on any site with a simple structure and I am adding it to my library of naughty hacks.
Along with this I have some other custom coded tools I use regularly. An audio player, and a .flv (ripped web vids) player. I'm working on some chat software that my wife and I can use at work to chat, and send files back and forth. Who needs winamp when you can write your own right!?