/
test_simple.js
37 lines (34 loc) · 1.17 KB
/
test_simple.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var nntp = require('../lib/nntp')
, path = require('path')
, fs = require('fs')
, sys = require('sys')
, assert = require('assert');
var creds = fs.readFileSync(path.join(__dirname, 'creds')).replace('\n','').split(',')
var c = nntp.createClient(undefined, 'news.giganews.com');
c.auth(creds[0], creds[1], function(error) {if (error) throw error; sys.puts('auth set')});
c.group('alt.binaries.comics.dcp', function (error, status, size, first, second) {
if (error) throw error;
var getit = function () {
c.head(first, function (error, headers){
sys.debug(sys.inspect(headers))
// c.body(first, function (error, body) {
// sys.puts(JSON.stringify(body.slice(0,500)));
// sys.puts(body.slice(0,500));
// first += 1;
// getit();
// })
})
}
getit();
//
// c.head(first, function (error, headers){
// sys.puts('head reply')
// if (error) throw error;
// c.body(first, function (error, body) {
// sys.puts('body reply '+first)
// if (error) throw error;
// sys.puts(JSON.stringify(body.slice(0,500)))
// sys.puts(body.slice(0,500))
// })
// })
});