cd /opt/
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
sudo tar xvjf phantomjs-1.9.1-linux-x86_64.tar.bz2
sudo chmod -R 777 phantomjs-1.9.1-linux-x86_64
sudo rm phantomjs-1.9.1-linux-x86_64.tar.bz2
sudo apt-get install libfreetype6 fontconfig
echo 'export PATH=$PATH:/opt/phantomjs-1.9.1-linux-x86_64/bin' >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-setuptools
sudo apt-get install python-rsvg
sudo apt-get install libcairo2
sudo easy_install pip
sudo pip install bottle
sudo pip install docopt
phantomjs svg_d3.js http://congress.joshreyes.com timeline > my_svg.svg
convert my_svg.svg -background white -flatten my_jpg.jpg
Launch
python phantom_svg_retriever.py web
Open your browser to http://localhost:8080/scrapesvg?dom_id=us-map&url=http://congress.joshreyes.com and enjoy
PhantomJS throught Python (generate also the image, PNG only supported at the moment)
python phantom_svg_retriever.py no_server http://congress.joshreyes.com timeline
If you want to change the default png name
python phantom_svg_retriever.py no_server http://congress.joshreyes.com timeline my_new_name.png
In both case, see your directory: a new png file was created