From dbc53b5371272d30fc4746f12d25ca5bb2d1a082 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Sat, 23 Mar 2013 00:39:26 -0700 Subject: [PATCH] Some updates. --- .gitmodules | 4 ++-- README | 0 convert_gifs_to_static.py | 24 ------------------------ download_gifs.js | 22 ---------------------- download_gifs.py | 1 - to_sqlite.js | 35 ----------------------------------- 6 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 README delete mode 100644 download_gifs.js delete mode 100644 to_sqlite.js diff --git a/.gitmodules b/.gitmodules index 2d78845..6227d8c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [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 diff --git a/README b/README deleted file mode 100644 index e69de29..0000000 diff --git a/convert_gifs_to_static.py b/convert_gifs_to_static.py index af52297..a4fb5f5 100644 --- a/convert_gifs_to_static.py +++ b/convert_gifs_to_static.py @@ -1,20 +1,3 @@ -# 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/" @@ -40,12 +23,6 @@ def main(): 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 @@ -80,4 +57,3 @@ def get_gif_num_frames(filename): if __name__ == "__main__": main() - diff --git a/download_gifs.js b/download_gifs.js deleted file mode 100644 index c73543d..0000000 --- a/download_gifs.js +++ /dev/null @@ -1,22 +0,0 @@ -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); -// } - diff --git a/download_gifs.py b/download_gifs.py index 92c1049..3a0b93c 100644 --- a/download_gifs.py +++ b/download_gifs.py @@ -4,7 +4,6 @@ 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] diff --git a/to_sqlite.js b/to_sqlite.js deleted file mode 100644 index 7663f01..0000000 --- a/to_sqlite.js +++ /dev/null @@ -1,35 +0,0 @@ -// 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(); -- 2.34.1