Skip to content

Instantly share code, notes, and snippets.

ack apple-gcc42 autoconf automake boost casperjs chromedriver chruby cscope elasticsearch faac ffmpeg fontconfig fontforge freetype gdbm geoip gettext gistit glew glib glm gmp gnutls gource hub imagemagick jansson jpeg lame libffi libgcrypt libgpg-error libpng libtasn1 libtiff libtool libvpx libyaml macvim mongodb mysql nettle node openssl p11-kit pcre phantomjs pkg-config rbenv readline ruby ruby-build samba sdl sdl_image snownews stunnel texi2html the_silver_searcher tree wget wireshark x264 xvid xz yasm zsh-syntax-highlighting

@dblooman
dblooman / slimerjs
Created November 19, 2013 16:27
Slimerjs cookies setting phantom nonsense
Slimerjs cookies are weird, for BBC, setting them required creating a profile
slimerjs -CreateProfile wraith
Then set command line options in config.yaml
phantomjs_options: -P wraith
Existing cookies will be disabled, also, you cant set cookies probably, so weather wont work.
  1. Copy the new fonts into the /usr/share/fonts/local/ directory

  2. Add fonts to font cache

fc-cache /path/to/

Install MS fonts from EC2

wget http://wraith.bbcnewshq.com/downloads/msttcore-fonts-2.0-3.noarch.rpm

rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm

var system = require('system');
var page = require('webpage').create();
var fs = require('fs');
if (system.args.length === 3) {
console.log('Usage: snap.js <some URL> <view port width> <target image name>');
phantom.exit();
}
var url = system.args[1];
var page = require('webpage').create();
page.open('http://www.bbc.co.uk/news', function () {
console.log(page.content);
phantom.exit();
});
require 'wraith'
require 'image_size'
require 'anemone'
require 'uri'
require 'selenium-webdriver'
class WraithManager
attr_reader :wraith
def initialize(config)
require 'yaml'
class Wraith
attr_accessor :config
def initialize(config_name)
@config = YAML::load(File.open("configs/#{config_name}.yaml"))
end
def directory
require 'wraith'
require 'image_size'
require 'anemone'
require 'uri'
require 'selenium-webdriver'
class WraithManager
attr_reader :wraith
def initialize(config)