[submodule "pjscrape"]
- path = pjscrape
- url = git@github.com:nrabinowitz/pjscrape.git
+ path = pjscrape
+ url = git@github.com:nrabinowitz/pjscrape.git
[submodule "phantomjs"]
path = phantomjs
url = git@github.com:ariya/phantomjs.git
-# import json
-# import os
-# from pprint import pprint
-# json_data = open('prelinger.json')
-
-# data = json.load(json_data)
-# #pprint(data)
-
-# for clip in data['clips']:
-# thumb = clip['thumbnail'].rpartition('?')[0]
-# print thumb
-# os.system('cd gifs/prelinger/; curl -O ' + thumb)
-
-# json_data.close()
-# convert gifs/prelinger/0540_1935_Pontiac_Advertising_R2_13_38_44_00_3mb.gif[3] -coalesce out.gif
-# convert gifs/prelinger/0540_Spain_in_Revolt_R3_13_00_52_20_3mb.gif -format "%[scenes]" info: | tail -n 1
-
import os
src_path="gifs/prelinger_anim/"
dest_path="gifs/prelinger_static/"
staticFrame = 0;
os.system('convert ' + src_path + gif + '[' + str(staticFrame) + '] -coalesce ' + dest_path + gif)
- # try:
- # with open(dest_path + gif) :
- # os.system('convert ' + src_path + gif + '[' + str(staticFrame) + '] -coalesce ' + dest_path + gif)
- # pass
- # except IOError:
- # print 'Oh dear.'
class GIFError(Exception): pass
if __name__ == "__main__":
main()
-
+++ /dev/null
-var exec = require('child_process').exec;
-var clips = require('./prelinger.json'); clips = clips.clips;
-
-// var count = 0;
-
-// var dl_thumb = function (t) {
-// console.log("downloading", t);
-// exec('cd gifs/prelinger; curl -O ' + t);
-// count++;
-// }
-
-
-setInterval(function(){
- console.log('hit');
-}, 2000);
-
-
-// for (var i = 0; i < 1; i++) {
-// var t = clips[i]['thumbnail'].split("?")[0];
-// dl_thumb(t);
-// }
-
json_data = open('prelinger.json')
data = json.load(json_data)
-#pprint(data)
for clip in data['clips']:
thumb = clip['thumbnail'].rpartition('?')[0]
+++ /dev/null
-// output to sqlite
-
-var thumbs = require('./prelinger_thumbs.json');
-
-console.log(thumbs[0]);
-
-var sqlite3 = require('sqlite3').verbose();
-var db = new sqlite3.Database('prelinger.db');
-db.serialize(function() {
-
- db.run("CREATE TABLE lorem (info TEXT)");
-
- /*
-CREATE TABLE IF NOT EXISTS entries(
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-added DEFAULT CURRENT_TIMESTAMP,
-link TEXT,
-title TEXT,
-desc TEXT,
-url TEXT,
-mimetype TEXT)
- */
-
- var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
- for (var i = 0; i < 10; i++) {
- stmt.run("Ipsum " + i);
- }
- stmt.finalize();
-
- db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
- console.log(row.id + ": " + row.info);
- });
-});
-
-db.close();