Hi,
I've realized a very basic bot but which allow me to update my ds during the
night (concerning the freenet website in html).
I cannot understand that some sites are reachable by my bot but not by the
browser.
So here is the bot :
import java.util.*;
import java.io.*;
import java.net.*;
public class TestFreenet {
public static String FRENCH_FREENET =
"http://localhost:8888/SSK@QXdj~vk7FIHFPYcLnuxjw4CtjaMPAgM/Freenet_en_Franca
is//";
public static String RAINY =
"http://localhost:8888/SSK@qYAOdd0miY88Gt3DEkDHlSjHLH4PAgM/html-9//";
public static String GPL =
"http://localhost:8888/SSK@WiTuXctmiv4IA09Ow1IJPxqdkLQPAgM/gpl//";
public static String WOOKIE =
"http://localhost:8888/SSK@De48eyKvA132GLzM3iIyon30JvoPAgM/wookie//";
public static String LEETISMO =
"http://localhost:8888/SSK@CvA~Z4TdWBYMocvZLRCejZ63NwMPAgM/leetismo//";
public static String SACRAMENTO =
"http://localhost:8888/SSK@nMXYgox1dJjFBaqo93-dUT1ju1APAgM/";
public static String DANGERBOOK =
"http://localhost:8888/SSK@wiR7E3ztfurc-81vboXNhkl58oYPAgM/dangerousbook//";
public static String BOOBIE =
"http://localhost:8888/SSK@taI2ZsMy4~zQ9YI2nhrKod84KBkPAgM/Boobietown//";
public static String RAW =
"http://localhost:8888/SSK@jbf~W~x49RjZfyJwplqwurpNmg0PAgM/rawfreedom//";
public static String GEARBOX =
"http://localhost:8888/SSK@tjDtIPMC6N2i2asj8hD-m3PzqLQPAgM/gearbox/0x03//";
public static String FROH =
"http://localhost:8888/SSK@YSH~iI0PwcZycWhPFoghYiPzjFsPAgM/froehnet/1//";
public static String FREE_DC =
"http://localhost:8888/SSK@rjYFfgPHfolmcStiaoxESFfBXz8PAgM/LetsFreeDC/2//";
public static String DESTROY_COMP =
"http://localhost:8888/SSK@F-6cSdCmQBPSxg2-9qpNeBD8ygQPAgM/destroycomputer//
";
public static String HALLOWEEN =
"http://localhost:8888/SSK@2UksEkp7VkTxxrA2BLSY6VioheUPAgM/halloweenprops/1/
/";
public static String OIL =
"http://localhost:8888/SSK@bFXfuVYZi1wReoLXmAqS~lVcfYUPAgM/Demosthenes/Oil.h
tml";
public static String KABOUM =
"http://localhost:8888/SSK@yyLr4EOVJ5n4x3EF7eMBDNv3n0MPAgM/KaBooM//";
public static String LAND =
"http://localhost:8888/SSK@AUmQdkbfCHXcyJYCOjZQLol1BW8PAgM/landofthefree//";
public static String ATH =
"http://localhost:8888/SSK@SVk1gFQPoO3sz-Mm7UtoF3zfWRcPAgM/Ahtbnsoa//";
public static String MEGALOMANIA =
"http://localhost:8888/SSK@QbDcroA0dtQirlKpdVID-UDhA7gPAgM/weborg/megalomani
a3//";
public static String CALORIES =
"http://localhost:8888/SSK@lcDsZ9WKMopKeL1szUGaLhLoVzAPAgM/calories//";
public static void main(String args[]) {
while (1 == 1) {
printURL(FRENCH_FREENET);
printURL(RAINY);
printURL(GPL);
printURL(WOOKIE);
printURL(LEETISMO);
printURL(SACRAMENTO);
printURL(DANGERBOOK);
printURL(BOOBIE);
printURL(RAW);
printURL(GEARBOX);
printURL(FROH);
printURL(FREE_DC);
printURL(DESTROY_COMP);
printURL(HALLOWEEN);
printURL(OIL);
printURL(KABOUM);
printURL(LAND);
printURL(ATH);
printURL(MEGALOMANIA);
printURL(CALORIES);
}
}
static InputStream in = null;
static DataInputStream data = null;
static String line = null;
public static void printURL(String ch) {
try {
in = new URL(ch).openStream();
data = new DataInputStream(new BufferedInputStream(in));
while ((line = data.readLine()) != null) {
System.out.println(line);
}
} catch (IOException ie) {
System.out.println("io exception : " + ie.getMessage());
}
}
}
Ok that's fine for the html pages but not for the images so I decided to do
the same thing for the images however I cannot understand the f**** io
classes of java concerning the binary files.
What I've done is the same thing putting the url of the images instead of
url of the html file (and storing the img on my disk), but it only react
like it want to see text and not binary ....Ok it's readline() so I looked @
the Javadoc but try a lot of stuff for the file however did'nt manage to do
the same thing for binary files. I tried BufferedInputStream,
ByteArrayInputStream and so on.... Have you got a good web site which
explain that or could you say me how I need to proceed to make that ? I
never saw a language as complicated to make a very basic stuff...
Other thing I remark is that some site which are in my bot are well stored
on the datastore but apparently it is not the case for all the site ...
Could you explain me why ?
C U,
blured.
_______________________________________________
support mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org/cgi-bin/mailman/listinfo/support