]> git.quilime.com - visual-archive.git/commitdiff
Added thumbscraper for image frames
authorGabriel Dunne <gdunne@quilime.com>
Sun, 7 Apr 2013 00:40:38 +0000 (17:40 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Sun, 7 Apr 2013 00:40:38 +0000 (17:40 -0700)
scripts/thumb_scrape_config.js [new file with mode: 0644]

diff --git a/scripts/thumb_scrape_config.js b/scripts/thumb_scrape_config.js
new file mode 100644 (file)
index 0000000..72537bb
--- /dev/null
@@ -0,0 +1,30 @@
+var urls = [
+       'http://archive.org/movies/thumbnails.php?identifier=0924_Greatest_Name_in_Wine_The_11_00_13_15'
+];
+
+pjs.config({
+  timeoutInterval: 5000,
+  timeoutLimit: 10000,
+  format: 'json',
+  writer: 'file',
+  outFile: 'scrape_output.json',
+  pageSettings : { loadImages : false }
+});
+
+pjs.addSuite({
+  url: urls,
+  scrapers: [
+  function() {
+               var r = {};
+               var thumbnail_links = $('.box div a').map(function() {
+        return {
+                                       img: $('img', this).attr('src'),
+                                       link: $(this).attr('href')
+        }
+        }).toArray();
+               r['url'] = window.location.href;
+               r['thumbnails'] = thumbnail_links;
+               return r;
+  }
+]
+});