--- /dev/null
+var system = require('system'),
+ page = require('webpage').create();
+
+page.open(system.args[1], function () {
+ var th = page.evaluate(function () {
+ return document.getElementById('thumbnail').src;
+ });
+ console.log(th);
+ //console.log(JSON.stringify({ thumbnail : th }));
+ phantom.exit();
+});
var system = require('system');
var page = require('webpage').create();
-
-var prelinger_ids = require('./prelinger_identifiers.json');
-var ids = prelinger_ids.identifiers;
var url_details = "http://archive.org/details/";
if (system.args.length === 1) {
console.log('Identifier Required');
} else {
var id = system.args[1];
-
-
-
page.open(url_details + id, function () {
var th = page.evaluate(function () {
return document.getElementById('thumbnail').src;
--- /dev/null
+var exec = require('child_process').exec;
+var fs = require("fs");
+
+// fs.readFileSync('./input.txt').toString().split('\n').forEach(function (line) {
+// console.log(line);
+// fs.appendFileSync("./output.txt", line.toString() + "\n";
+// });
+
+var prelinger = require('./prelinger_identifiers.json');
+
+var output = { "clips" : [] };
+for (var i = 0; i < prelinger.identifiers.length; i++) {
+ var id = prelinger.identifiers[i];
+ output.clips[i] = { "id" : id };
+}
+
+fs.open("./output.txt", 'w', 0666, function(err, fd) {
+ fs.writeSync(fd, JSON.stringify(output) + "\n", null, undefined, function(err, written) {
+ })
+});
+
+// "http://archive.org/details/" +
+
+// var id = '0924_Greatest_Name_in_Wine_The_11_00_13_15';
+// cmd = spawn('phantomjs' ['phantom-scrape-id.js']);
+
+
+
--- /dev/null
+var system = require('system');
+var page = require('webpage').create();
+var url_details = "http://archive.org/details/";
+
+if (system.args.length === 1) {
+ console.log('Identifier Required');
+} else {
+ var id = system.args[1];
+ page.open(url_details + id, function () {
+ var th = page.evaluate(function () {
+ return document.getElementById('thumbnail').src;
+ });
+ console.log(th);
+ phantom.exit();
+ });
+}
+++ /dev/null
-
-var identifier = "animals_in_the_service_of_man_2";
-var url_details = "http://archive.org/details/";
-
-var page = require('webpage').create();
-page.open(url_details + identifier, function () {
- // page.render('page.png');
-
- var ua = page.evaluate(function () {
- return document.getElementById('thumbnail').src;
- });
-
- console.log(ua);
- phantom.exit();
-});